[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
slackbook:bash [2012/09/08 18:07 (UTC)] – [Customization] updated section to match original with formatting mfillpot | slackbook:bash [2012/09/12 20:39 (UTC)] – [Sources] Fixed syntax for bullet points sycamorex | ||
---|---|---|---|
Line 41: | Line 41: | ||
- | < | + | < |
darkstar:~$ set FOO=bar | darkstar:~$ set FOO=bar | ||
darkstar:~$ echo $FOO | darkstar:~$ echo $FOO | ||
Line 57: | Line 57: | ||
- | < | + | < |
darkstar:~$ set PS1=' | darkstar:~$ set PS1=' | ||
darkstar:~$ export PS1=' | darkstar:~$ export PS1=' | ||
Line 78: | Line 78: | ||
- | < | + | < |
darkstar:~$ ifconfig | darkstar:~$ ifconfig | ||
bash: ifconfig: command not found | bash: ifconfig: command not found | ||
Line 91: | Line 91: | ||
- | < | + | < |
darkstar:~$ su - | darkstar:~$ su - | ||
Password: | Password: | ||
Line 114: | Line 114: | ||
- | < | + | < |
darkstar:~$ touch b ba bab | darkstar:~$ touch b ba bab | ||
darkstar:~$ ls * | darkstar:~$ ls * | ||
Line 133: | Line 133: | ||
- | < | + | < |
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: | ||
- | < | + | < |
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. | dealing with long filenames: tab completion. | ||
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 < | + | by hitting the <key>'TAB'</ |
the rest for you. Even if you haven' | the rest for you. Even if you haven' | ||
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: | ||
- | < | + | < |
darkstar:~$ echo foo | darkstar:~$ echo foo | ||
foo | foo | ||
Line 203: | Line 203: | ||
- | < | + | < |
darkstar:~$ echo foo | darkstar:~$ echo foo | ||
foo | foo | ||
Line 226: | Line 226: | ||
- | < | + | < |
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: | ||
- | < | + | < |
darkstar:~$ fromdos < dosfile | darkstar:~$ fromdos < dosfile | ||
</ | </ | ||
Line 253: | Line 253: | ||
- | < | + | < |
darkstar:~$ ps auxw | grep getty | darkstar:~$ ps auxw | grep getty | ||
root 2632 0.0 0.0 | root 2632 0.0 0.0 | ||
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'</ |
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. | process later. | ||
Line 274: | Line 274: | ||
- | < | + | < |
darkstar:~$ jobs | darkstar:~$ jobs | ||
[1]- Stopped | [1]- Stopped | ||
Line 288: | Line 288: | ||
- | < | + | < |
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>'F1'</ |
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: | ||
- | < | + | < |
alan@darkstar: | alan@darkstar: | ||
Line 355: | Line 355: | ||
- | < | + | < |
bash-3.1$ </ | bash-3.1$ </ | ||
Line 376: | Line 376: | ||
- | < | + | < |
# ~/.bashrc | # ~/.bashrc | ||
Line 401: | Line 401: | ||
- | < | + | < |
darkstar:~$ echo $PS1 | darkstar:~$ echo $PS1 | ||
\u@\h:\w\$ </ | \u@\h:\w\$ </ | ||
Line 409: | Line 409: | ||
**// | **// | ||
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>'\'</ |
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. | discuss them all, but I'll explain these. | ||
the username of the current user. //" | the username of the current user. //" | ||
the terminal is attached to. //" | the terminal is attached to. //" | ||
- | //" | + | //" |
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: | ||
- | < | + | < |
Wed Jan 14 12:08 AM | Wed Jan 14 12:08 AM | ||
alan@raven: | alan@raven: | ||
Line 443: | Line 443: | ||
and barometric pressure! | and barometric pressure! | ||
+ | ====== Chapter Navigation ====== | ||
+ | |||
+ | **Previous Chapter: [[slackbook: | ||
+ | |||
+ | **Next Chapter: [[slackbook: | ||
====== Sources ====== | ====== Sources ====== | ||
<!-- If you copy information from another source, then specify that source --> | <!-- If you copy information from another source, then specify that source --> | ||
- | * Original source: [[http:// | + | |
<!-- Authors are allowed to give credit to themselves! --> | <!-- Authors are allowed to give credit to themselves! --> | ||
- | < | + | |
<!-- * Contrbutions by [[wiki: | <!-- * Contrbutions by [[wiki: | ||