Bash commands

Drives and mounts

  • df gives info on currently mounted filesystems.
  • du gives a size breakdown on directories. Suggested script: du . | sort -n | tail to find biggest offenders.

Files and directories

Find cribsheet:

  • find . -type {d,f} -[i]name “*thing*” -execdir <command> {} \; where execdir is transparently more secure than exec, the {} expands to the current file in the exec command, and for some reason that [space]\; is required.

Only affect files/folders:

  • find . -type d -execdir chmod 755 {} \; for directories.
  • find . -type f -execdir chmod 644 {} \; for files.

Yet another random section

  • Running simulations: nohup nice -n 9 <command> > something.out 2> something.err < /dev/null &
bash_commands.txt · Last modified: 2009/02/12 05:43 by jobriath
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki