1
vote
4answers
138 views

Randomly shuffle rows in a large text file

I have a text file of ~1GB with about 6k rows (each row is very long) and I need to randomly shuffle its rows. Is it possible? Possibly with awk?
0
votes
1answer
202 views

Filtering output from the “dscl -readall” command

dscl . -readall /Users outputs something like this (only a part of the entire output): PrimaryGroupID: 20 RealName: Johnny Smith RecordName: johnny RecordType: dsRecTypeStandard:Users UniqueID: ...
1
vote
2answers
173 views

Using sh -c in terminal

I have this command line that I enter into terminal and it works as intended: dscl . -readall /Users UniqueID | awk '/^RecordName:/ {name=$2}; /^UniqueID: / {if ($2 > 500) print name}' What I ...
0
votes
1answer
204 views

list files with full modification date

I want to produce a list of files in a directory and feed it into a script to generate database entries including their creation dates. The database is Solr, so I need to be able to translate ISO 8601 ...
2
votes
2answers
650 views

Join two lines with awk or sed

If I have: foo bar ..and I'd like to awk/sed this to: foo-bar ..what's the syntax? I'm trying to use System Profiler on OS X 10.6.x: system_profiler SPMemoryDataType | awk '/Type/ {print $2} ...
8
votes
3answers
8k views

Filtering top command output

I'm running a Mac and want to filter the output of the top command for a particular process such that only the PID, COMMAND and %CPU columns are displayed. After getting the PID of the process, I ...