Monthly Archives: November 2009

tail

Lists in real time with continuous update the last lines of file tail -f file Lists the last m lines from file tail -n m file Lists starting from the m-th line tail -n +m file

Uncategorized

head

Lists the first m lines from file head -n m file

Uncategorized

touch

Creates file if it doesn’t exist of if exists resets atime,ctime and mtime.

Uncategorized

rm

Force remove (no confirmation) rm -f Forced recursive deletion :: EXTRA CARE when using any kind of / in the path : a space after the first / would delete EVERYTHING of the HD rm -rf path

Uncategorized

cp

Recursive copy cp -r Preserves the owner, group and perms cp -p Forced copy (does not prompt to overwrite) cp -f

Uncategorized

mv

Force move mv -f Update (moves only if the source is newer than the destination) mv -u

Uncategorized

mkdir

Created dir and subdirs if needed (without -p it returns an error if a sub-parent also needs to be created) mkdir -p path

Uncategorized

ls

Adds a file type identifier: ls -F Identifier: / => folder @ => symbolic link = => socket | => pipe * => executable Lists files long format, ordered by size, human readable sizes ls -lSh List long ordered by … Continue reading

Uncategorized

less

enter lists the next line space lists the next screen d down half a screen u up half a screen /string search for string downwards ?string search for string upwards n next occurance N previous occurance g or < jump … Continue reading

Uncategorized

grep

Echo n lines of trailing (after) context lines grep -A n patern file Echo n lines of leading (before) context lines grep -B n patern file Echo n lines of output context lines grep -C n patern file Colorize the … Continue reading

Uncategorized