Accueil > Shell > Some shell commands

Some shell commands

28/01/2009

Put current date to extracted files from a tar

# touch `tar tvf tarfile.tar | grep "extentionOfFileToBeTouch" | awk '{ print $8 }' `

Find a file

# find . -name [filename]

Find a file or a directory

# find . -type [filename|directoryname]

Find all the files that contain the given text

# find . -type f | xargs grep [text]

Find all files upper or lower than a given size

In byte (b) or in KiloByte (k)

# find . -size [+|-] x[b|k]

Find all the files that are newer than an other given file

# find . -newer file

Find a working processus by its name

# ps -edf [process name] | grep -v grep

Get informations of all the device disk

# df

Get the disk usage of the given files or folders

k for kilo s for summary

# du -ks [file|folder]


Shell

Les commentaires sont fermés.