Pages

Showing posts with label Linux Command Line. Show all posts
Showing posts with label Linux Command Line. Show all posts

Thursday, March 3, 2011

Linux Commands to get you started

'man'
  • Command mode accessible through ESC
  • /<search string>  - use 'n' to continue search
  • 'b' to go up a page
'info'
  • Control-S used to search
  • 'control-s' to continue the search
  • Control-G to end that task
  • Set up cursor on index points and hit enter to be taken to that section
  • Use 'l' to return to previous position with relation to indexed point
'man -k <keyword>' looks for keyword one-line synoposis entries
'apropos <keyword>' identical to above

'vi'
  • vi editor, command mode accessible through ESC
  • 'dd' - deletes a line
  • '/' search, similar to man pages
  • :wq - write and quit
  • :q! - quit without writing
'rm <file>' remove a file
'rm -i <file>' , interact flag for rm - prompt for confirmation on file deletion
'mkdir <name>' , create a directory
'rmdir <name>', remove an empty directory

'ls' - list the contents of current location
'ls -a' - list the contents of current location including all files beginning with a period (.)
'ls -l' - long listing format, includes DAC layout, along with other properties.

'cp' - copy
'mv' - rename/move

Terms to be aware of:  Absolute path - begins with a '/'
Relative path: - relative to the current directory inwhich the command is executed

Special files for easy configuration.

.bash_profile, easily modify the path to search for programs!
.bashrc , easily modify aliases surrounding common commands you may use.
example:  alias rm='rm -i'

source <file> , ie: source .bashrc
implement changes/take effect the current changes made, without exit/relogging.

nroff input for man pages is kept in /usr/share/man/manX, compressed with gzip to save space.  'man' knows how to uncompress on the fly.

Formatted versions of the manuals are kept in /var/cache/man/catX.  Should the directory be writable, man will also deposit the formatted pages as they are created, generating a cache of commonly read man pages.

'manpath' will display the path 'man' utilizes when searching for manual pages as per your request.  The system wide default can be configured in /etc/man.config (on some distributions)  The PAGER environment variable controls the way inwhich the listing of the man pages is utilized, typically using 'less'.