Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
slackbook:bash [2012/09/08 18:10 (UTC)]
mfillpot [Sources] updated author list
slackbook:bash [2012/09/12 19:55 (UTC)]
mfillpot updated code block to syntax highlighting
Line 41: Line 41:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ set FOO=bar darkstar:~$ set FOO=bar
 darkstar:~$ echo $FOO darkstar:~$ echo $FOO
Line 57: Line 57:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ set PS1='​FOO ' darkstar:~$ set PS1='​FOO '
 darkstar:~$ export PS1='​FOO ' darkstar:~$ export PS1='​FOO '
Line 78: Line 78:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ ifconfig darkstar:~$ ifconfig
 bash: ifconfig: command not found bash: ifconfig: command not found
Line 91: Line 91:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ su - darkstar:~$ su -
 Password: ​ Password: ​
Line 114: Line 114:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ touch b ba bab darkstar:~$ touch b ba bab
 darkstar:~$ ls * darkstar:~$ ls *
Line 133: Line 133:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ ls a[1-4,9] darkstar:~$ ls a[1-4,9]
 a1 a2 a3 a4 a9 a1 a2 a3 a4 a9
Line 145: Line 145:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ ls 1[W-b] darkstar:~$ ls 1[W-b]
 1W 1X 1Y 1Z 1a 1b 1W 1X 1Y 1Z 1a 1b
Line 162: Line 162:
 dealing with long filenames: tab completion. ​ Tab completion enables dealing with long filenames: tab completion. ​ Tab completion enables
 you to type just enough of the filename to uniquely identify it, then you to type just enough of the filename to uniquely identify it, then
-by hitting the <​key>​TAB</​key>​ key, **//​bash//​** will fill in+by hitting the <key>'TAB'</​key>​ key, **//​bash//​** will fill in
 the rest for you.  Even if you haven'​t typed in enough text to uniquely the rest for you.  Even if you haven'​t typed in enough text to uniquely
 identify a filename, the shell will fill in as much as it can for you. identify a filename, the shell will fill in as much as it can for you.
Line 183: Line 183:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ echo foo darkstar:~$ echo foo
 foo foo
Line 203: Line 203:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ echo foo darkstar:~$ echo foo
 foo foo
Line 226: Line 226:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ rm bar darkstar:~$ rm bar
 rm: cannot remove `bar': No such file or directory rm: cannot remove `bar': No such file or directory
Line 240: Line 240:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ fromdos < dosfile ​ darkstar:~$ fromdos < dosfile ​
 </​code>​ </​code>​
Line 253: Line 253:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ ps auxw | grep getty darkstar:~$ ps auxw | grep getty
 root      2632  0.0  0.0   ​1656 ​  532 tty2     ​Ss+ ​ Feb21   0:00 /​sbin/​agetty 38400 tty2 linux root      2632  0.0  0.0   ​1656 ​  532 tty2     ​Ss+ ​ Feb21   0:00 /​sbin/​agetty 38400 tty2 linux
Line 267: Line 267:
 temporarily halt a running process, perform some other task, then temporarily halt a running process, perform some other task, then
 resume it or optionally make it run in the background. Upon pressing resume it or optionally make it run in the background. Upon pressing
-<​key>​CTRL-Z</​key>,​ **//​bash//​** will suspend+<key>'CTRL'</​key>​+<​key>'​z'​</​key>,​ **//​bash//​** will suspend
 the running process and return you to a prompt. You can return to that the running process and return you to a prompt. You can return to that
 process later. ​ Additionally,​ you can suspend multiple processes in process later. ​ Additionally,​ you can suspend multiple processes in
Line 274: Line 274:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ jobs darkstar:~$ jobs
 [1]-  Stopped ​                vi TODO [1]-  Stopped ​                vi TODO
Line 288: Line 288:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ fg # "vi TODO" darkstar:~$ fg # "vi TODO"
 darkstar:~$ fg 1 # "vi chapter_05.xml"​ darkstar:~$ fg 1 # "vi chapter_05.xml"​
Line 320: Line 320:
 applications. Each of these gettys is available on different tty applications. Each of these gettys is available on different tty
 devices that are accessible seperately by pressing the devices that are accessible seperately by pressing the
-<​key>​ALT</​key>​ key and one of the function keys from +<key>'ALT'</​key>​ key and one of the function keys from 
-<​key>​F1</​key>​ through <​key>​F6</​key>​. Using these gettys+<key>'F1'</​key>​ through <key>'F6'</​key>​. Using these gettys
 allows you to login multiple times, perhaps as different users, and run allows you to login multiple times, perhaps as different users, and run
 applications in those users' shells silmutaneously. This is most applications in those users' shells silmutaneously. This is most
Line 348: Line 348:
  
  
-<​code>​+<​code ​bash>
 alan@darkstar:​~$ </​code>​ alan@darkstar:​~$ </​code>​
  
Line 355: Line 355:
  
  
-<​code>​+<​code ​bash>
 bash-3.1$ </​code>​ bash-3.1$ </​code>​
  
Line 376: Line 376:
  
  
-<​code>​+<​code ​bash>
  
 # ~/.bashrc # ~/.bashrc
Line 401: Line 401:
  
  
-<​code>​+<​code ​bash>
 darkstar:~$ echo $PS1 darkstar:~$ echo $PS1
 \u@\h:\w\$ </​code>​ \u@\h:\w\$ </​code>​
Line 409: Line 409:
 **//​bash//​** prompt. Basicaly, every character in **//​bash//​** prompt. Basicaly, every character in
 the PS1 variable is included in the prompt, unless it is a escaped by a the PS1 variable is included in the prompt, unless it is a escaped by a
-<​key>​\</​key>,​ which tells **//​bash//​** to+<key>'\'</​key>,​ which tells **//​bash//​** to
 interpret it. There are many different escape sequences and we can't interpret it. There are many different escape sequences and we can't
 discuss them all, but I'll explain these. ​ The first //"​\u"//​ translates to discuss them all, but I'll explain these. ​ The first //"​\u"//​ translates to
 the username of the current user.  //"​\h"//​ is the hostname of the machine the username of the current user.  //"​\h"//​ is the hostname of the machine
 the terminal is attached to. //"​\w"//​ is the current working directory, and the terminal is attached to. //"​\w"//​ is the current working directory, and
-//"​\$"//​ displays either a <​key>#</​key>​ or a <​key>​$</​key>​ sign,+//"​\$"//​ displays either a <key>'#'</​key>​ or a <key>'$'</​key>​ sign,
 depending on whether or not the current user is root.  A complete depending on whether or not the current user is root.  A complete
 listing of all prompt escape sequences is listed in the listing of all prompt escape sequences is listed in the
Line 425: Line 425:
  
  
-<​code>​+<​code ​bash>
 Wed Jan 14 12:08 AM Wed Jan 14 12:08 AM
 alan@raven:​~$ echo $PS1 alan@raven:​~$ echo $PS1

In Other Languages
QR Code
QR Code slackbook:bash (generated for current page)