philippe::niquille | irregular niche market thoughts

linux commands & hacks

Jun 10th 2005
3 Comments
respond
trackback

Some stuff which is good to know:

  • ps aux | grep your process name
    Search for a running process (here clamd), kill it with the following:
    kill process id or killall process name
  • man your_command
    Manual for specific command. Search the manual with /what you want to search for.
  • find /usr/local -name “myfile.c
    Search for any file ex. in /usr/local.
  • mysqldump -u your_user mysql_db > dump.sql
    Dump a mysql db to a .sql file. Very userful for backups. Import with this:
    mysql -u your_user mysql_db< dump.sql
  • mysqladmin -u root password ‘new password’
    Change root password (really do it!! I have seen alot of systems without root pw..)
  • cat file | grep what you are looking for
    Output whole file to command line and search for string.
  • tail file
    Just output end of file. (Very usefull for logfiles.)
  • du -xh | sort -nr | head -10
    Get the ten biggest files and their file size in the current directory. (-h is for human readable size values.)
  • df -H
    Get total disk space used/free on all mounted drives (even smb!).
  • whereis appname or locate app
    I think whereis is fedora specific (when you use rpm). Get the folder where the binary is.
  • finger or w
    See who else is logged in.
  • passwd user
    Change password for user.
  • rm -fr folder or files
    Delete everything without asking (even folders).
  • cp -R directory where to
    Copy a whole directory with all subs.
  • tar xvzf file.tar.gz
    Extract tar.gz file.
  • tar -cvzf file.tar.gz what you want to pack
    Pack a tar.gz file.
  • uname -mrs or uname -a
    Get system information.
  • rpm -ql package
    Display content of installed rpm package.
  • scp local_files user@your_remote_host:port
    Copy files to a remote linux system over ssh.

And try this if you want to patch your orinoco_cs driver with monitor mode (for kismet, etc.).

3 Comments

  1. if you do a tail -f , it will give you a real time screen when stuff gets added to the file.

    Great for watch logs [i.e. tail -f /var/log/messages]

    Nice site

  2. update:
    use the command script /your/path/tofile to record the entire screen output of your console! End it with exit.

  3. Just stumbled over this cool site with additional command references:
    http://www.iol.ie/~padraiga/cmdline.html

Incoming Links

Leave a Reply