Check These Out
This command will find the biggest files recursively under a certain directory, no matter if they are too many. If you try the regular commands ("find -type f -exec ls -laSr {} +" or "find -type f -print0 | xargs -0 ls -laSr") the sorting won't be correct because of command line arguments limit.
This command won't use command line arguments to sort the files and will display the sorted list correctly.
This is assuming that you're editing some file that has not been wrapped at 80 columns, and you want it to be wrapped. While in Vim, enter ex mode, and set the textwidth to 80 columns:
$ :set textwidth=80
Then, press:
$ gg
to get to the top of the file, and:
$ gqG
to wrap every line from the top to the bottom of the file at 80 characters.
Of course, this will lose any indentation blocks you've setup if typing up some source code, or doing type setting. You can make modifications to this command as needed, as 'gq' is the formatting command you want, then you could send the formatting to a specific line in the file, rather than to the end of the file.
$ gq49G
Will apply the format from your current cursor location to the 49th row. And so on.
Manages everything through one sed script instead of pipes of greps and awks. Quoting of shell variables is generally easier within a sed script.
Execute matlab sentences in shell script:
for var in `seq 0 0.2 1` ; do
echo "my_function($var);" | matlab -nodisplay
done
sorts the contents of a file without the need for a second file to take the sorted output.
This was previously entered as `sort -g list.txt -o $_` but as others have pointed out the $_ references the previous command. so this would've worked had that been the second part of a command joined with && like:
cat list.txt && sort -g list.txt -o $_
The user below me Robin had the most correct command.
Using this command you can track a moment when usb device was attached.
Character: "?" is the Byte Order Mark (BOM) of the Unicode Standard.
Specifically it is the hex bytes EF BB BF, which form the UTF-8 representation of the BOM,
misinterpreted as ISO 8859/1 text instead of UTF-8.
To replace foo by bar, but not execute, do ^foo^bar^:p
To replace all foo by bar, but not execute, do ^foo^bar^:&:p