Monday, June 22, 2009

Several Linux Command Lines

  1. $ (cd Ti/Davinci/ && make)
    - jump to a directory and execute a command, and then jump back to current directory.
  2. $ ls –ltr | tail –n5
    - 5 newest files only
  3. $ ctrl-L
    - clear terminal screen, or use ‘clear’
  4. $ mkdir –p dir1/dir2/dir3, $mkdir –p work/{d1,d2}/{d3,d4}
    -create directory including intermediate directories.
  5. $ cp filename.txt{,.bak}, or $mv filename{.dat,.bak}
    -backup or rename
  6. $ grep --color=auto
    -show pattern in Red
  7. $ ps aux | grep “[s]peed”
  8. $ rm –rf `find . –type d –name .svn`
    -remove all subversion files.
  9. $ sed -n 5p
    - show one specific line if you know what line it is.

No comments:

Post a Comment