2505_fact_sheet

2505_fact_sheet - Ps l gives a list of programs running;...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Ps –l gives a list of programs running; man gives info on a given command; directories are always followed by a /; the home directory (or root directory) is represented by only a single \; absolute pathnames begin from the home directory; relative pathnames relate to your working directory; pwd gives you your current directory; ls –l gives files and information in current directory; cd command changes directories (alone moves you to the home directory); . refers to current directory; . . refers to the path of the current directory (relative path name use); mkdir, rmdir ; copy files with cp name of file dest of file ; move files with mv name of file dest of file ; cat and less to display contents of a file; head and tail to view parts of a file; bzip2 , bunzip2 ; tar x or c vf name of file dest of file ; permissions: file type/file permissions (owner group other)/number of links/owner/group/size/time/file name; change permissions with chmod (0 no access permissions; 1 execute permissions; 2 write to permissions; 4 read from permissions) – can also represent each in binary (i.e., 7 = 111); be carefule with rm when removing files; copy a file remotely with scp name of file address of remote machine directory ; which command tells you where a command resides; HOME variable gives home directory; PATH determines which directories the shell will search; shell searches the directories in the path variable, in the order they occur in the path, and runs the first executable file (with the correct name) that is found (add paths to this value by adding directory to PATH in .bash_profile (can also change from the command line, will only last the session) PATH=$PATH:. ; three kinds of shells: interactive login shells (/etc/prfile – root user can modify, ~/.bash_profile – files in home directory you can change, ~/.bash_login, ~/.profile and interactive nonlogin shells (/etc/bashrc, ~/.bashrc), and non-interactive shells (inherits login shell variables from files mentioned previously); hidden files begin with ., can be seen with ls –a command; configuring ~/.bash_profile: if [-f ~/.bashrc ]; then source ~/.bashrc fi; export PS1=’[\h \W \!]\$’; alias commands are convenient for created mnemonics for special executions of system commands. Regular expression : sequence of characters that specifies a set of strings which are said to match the regular expression; use grep – E ; period matches any single character; asterisk matches zero or more occurrences; plus matches one or more occurrences; grep –n specifies the number of lines; question mark matches zero or one occurrence; logical or matches RE before and after the |; caret used outside brackets matches only at beginning of a line; dollar sign matches only at end of a line; backslash escapes other meta (special) characters; square brackets specify a set of characters in a set (any character in the set will match) a caret on the brackets specifies the complement; parentheses forms a group of characters to be treated as a unit; braces specifies the number
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

2505_fact_sheet - Ps l gives a list of programs running;...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online