VanJohnson.com

random stuff from a digital immigrant
  • Home
  • Linux Stuff

Linux CLI (Level 1)

FUN WITH LINUX COMMAND LINE

This is a list of command line (CLI) functions you can use on *most Unix style systems. This list is more for the beginners looking to get something done from a command line. These are pretty basic and really not that exciting.

*Note some of these commands are specific to the bash shell or Operating System Distro.

# -- Copying and Moving Files -- #

PLAIN TEXT
  1. # Copy a file
  2. $ cp filename filename.backup
  3.  
  4. # Shortcut or the same command
  5. $ cp filename{,.backup}
  6.  
  7. # Move a file
  8. $ mv filename filename.backup
  9.  
  10. # Shortcut or the same command
  11. $ mv filename{,.backup}

# -- grep commands -- #

PLAIN TEXT
  1. $ grep -iR "something" /var/log | more
  2. # Search log files directory for "something"


# -- Navigation -- #

PLAIN TEXT
  1. $ cd path
  2. # Navigate directory via command line
  3.  
  4. $ cd ~
  5. # Return to home directory
  6.  
  7. $ cd -
  8. # Go back to last directory
  9.  
  10. $ mc
  11. # Command line "GUI" Midnight Commander
  12.  
  13. $ tree
  14. # Hierarchical display

# -- VI fun -- #

PLAIN TEXT
  1. # To edit multiple files in vi
  2. :split filename
  3.  
  4. # If you don't know the name of the
  5. # other file you want to edit you can use this sequence 
  6. :split # to open another session
  7. edit . # to navigate to another file. (Notice the period after the edit command)
  8.  
  9. # Or a shortcut of
  10. :split.
  11.  
  12. # When editing multiple files you switch between each file by
  13. # hitting <ctrl> ww

# -- System Commands -- #

PLAIN TEXT
  1. $ top
  2. # Displays dynamic real-time view of a running system
  3. # Additional trick from within top, is you type ? you
  4. # get a list of commands you can run within top
  5.  
  6. $ uptime
  7. # Tells how long the system has been running
  8.  
  9. $ kill PID
  10. # Kills the application association with the PID number defined
  11.  
  12. $ kill -9 PID
  13. # When a normal kill wont do the job, the switch -9
  14. # forces the system to kill a process
  15.  
  16. $ df -h
  17. # Reports filesystem disk space usage. The switch -h makes
  18. # it "Human Readable"
  19.  
  20. $ du -h --max-depth=2
  21. # Estimates file space usuage. -h makes it "Human Readabl"
  22. # and the -max-depth=2 only executes the commands down 2 levels.

# Command line applications

PLAIN TEXT
  1. $ lynx
  2. # Command line web browser
  3.  
  4. $ pine
  5. # Command line email reader
  6.  
  7. $ mutt
  8. # Another Command line email reader

# -- Misc -- #

PLAIN TEXT
  1. $ man command
  2. # Gives you the manual pages for a specified command (example man cp)
  3.  
  4. $ cal
  5. # Displays a Calendar
  6.  
  7. $ cal -3
  8. # Displays Previous, Current, and Next month calendars
  9.  
  10. $ date
  11. # Display current time and date
  12.  
  13. $ whereis program
  14. # Searches common locations for the program
  15.  
  16. $ whatis program
  17. # A short synopsis of what a program is.
  18.  
  19. $ locate
  20. # Find a files location via internal database
  21.  
  22. $ find / -name filename
  23. # A manual search for a file. In this case the
  24. # first argument of / (slash) means the entire system.
  25. # Searches can be narrowed down by define a path in this
  26. # place such as /home


# -- OTHER IMPORTANT COMMANDS WORTH DOING A 'man' ON -- #

PLAIN TEXT
  1. $ tar
  2. $ ls
  3. $ shutdown
  4. $ rpm
  5. $ chmod
  6. $ chown
  7. $ su
  8. $ sudo
  9. $ dd
  10. $ pico
  11. $ emacs
  12. $ rm
  13. $ crontab

Digg Facebook Google Reddit StumbleUpon del.icio.us

No Comment

Comments are closed.

Posting your comment.

  • My Twitter...

    • We had a visitor late last night. http://twitpic.com/aaqn 3 hrs ago
    • Evernotes web interface has really come a long way. Useable now from Linux - http://www.evernote.com 21 hrs ago
    • With all the @'s in my timeline, sometimes Twitter is like sitting in the middle of a busy cafe listening to everyones conversations 22 hrs ago
    • updating my status from Gnome-DO on Ubuntu just because I can. 1 day ago
    • I think we should redo "The Mojave Experiment" and replace Vista with Ubuntu and see what results we get. http://hellotxt.com/l/IqAK 2 days ago
    • More updates...
  • RSS Interesting Items

    • 15 Examples To Master Linux Command Line HistoryOpen Source News
    • Linux Myths: Busted!Open Source News
    • Eating Alfresco: the healthier FOSS alternative to SharePointOpen Source News
    • The Bizarre Cathedral - 18Open Source News
    • Free Software movement fights to keep internet freedom in BrazilOpen Source News
    • Quotable: Why Microsoft is Just a Standard Open Source ScamOpen Source News
    • Canonical Joins The Linux FoundationOpen Source News
    • Microsoft, Novell expand alliance with $100M deal (AP)Open Source News
    • A Practical Guide to GPL ComplianceOpen Source News
    • How To Become A Hacker (ESR Original)Open Source News
  • Pages

    • Linux Stuff
      • Linux CLI (Level 1)
      • Linux CLI (Level 2)
      • Linux Links
        • Great Linux Links
        • Live CDs
      • VI commands
  • Categories

    • Family
      • My Cancer
    • Funny
    • Geek Stuff
      • Apple
        • OSX
      • Firefox
      • Google
      • Linux
        • Ubuntu
      • Networking
      • Notes
      • Perl
      • PHP
        • PEAR
    • General
    • GTD
    • Just Really Cool
    • Microsoft
    • mysql
    • NotMyPosting
    • Open Source
    • QuickTip
    • Rant
    • Sony
    • Video
  • Recent Posts

    • Running Adobe Air On Linux
    • The Condition We Do Not Speak Of
    • Public Speaking
    • Getting Things Done - The Quicksilver Way
    • Fun with SAY
  • Links

    • Kirkwood.net
    • Photos
  • Links for Geeks

    • PHP.net
    • Shocm - Geek Stuff
  • Links Offsite

    • eSolves
    • SDABL
  • Archives

Copyright © 2008 VanJohnson.com