[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 revision | ||
slackbook:shell [2012/09/08 11:04 (UTC)] – [more] updated to match original article including formatting mfillpot | slackbook:shell [2014/05/21 08:39 (UTC)] (current) – [File and Directory Creation and Deletion] man -> mkdir zithro | ||
---|---|---|---|
Line 15: | Line 15: | ||
(short for **manual**) will bring up the included | (short for **manual**) will bring up the included | ||
man-page for any application, | man-page for any application, | ||
- | library you tell it too. For example, man man | + | library you tell it too. For example, |
will bring up the man-page for **//man//** itself. | will bring up the man-page for **//man//** itself. | ||
Line 196: | Line 196: | ||
"/ | "/ | ||
failed to use the //-p// argument, | failed to use the //-p// argument, | ||
- | **//man//** would fail to create "/ | + | **//mkdir//** would fail to create "/ |
unless the first two already existed, as you saw in the example. | unless the first two already existed, as you saw in the example. | ||
Line 328: | Line 328: | ||
strength. Unfortunately, | strength. Unfortunately, | ||
and CPU-intensive process, so **// | and CPU-intensive process, so **// | ||
- | typicall | + | typically |
==== XZ / LZMA ==== | ==== XZ / LZMA ==== | ||
The latest compression utility added to Slackware is | The latest compression utility added to Slackware is | ||
- | **//xz//**, which impliments | + | **//xz//**, which implements |
algorithm. This is faster than **// | algorithm. This is faster than **// | ||
often compresses better as well. In fact, its blend of speed and | often compresses better as well. In fact, its blend of speed and | ||
compression strength caused it to replace | compression strength caused it to replace | ||
**// | **// | ||
- | Slackware. | + | Slackware. |
a man page at the time of this writing, so to view available options, | a man page at the time of this writing, so to view available options, | ||
use the //--help// argument. | use the //--help// argument. | ||
Line 446: | Line 446: | ||
**// | **// | ||
text file until your screen is full, then pause. | text file until your screen is full, then pause. | ||
- | through that screen, you can proceed down one line by pressing ENTER, | + | through that screen, you can proceed down one line by pressing |
- | or an entire screen by pressing < | + | or an entire screen by pressing <key>'SPACE'</ |
specified number of lines by typing a number and then the | specified number of lines by typing a number and then the | ||
- | < | + | <key>'SPACE'</ |
capable of searching through a text file for keywords; once you've | capable of searching through a text file for keywords; once you've | ||
displayed a file in **// | displayed a file in **// | ||
- | key and enter a keyword. | + | key and enter a keyword. |
text will scroll until it finds the next match. | text will scroll until it finds the next match. | ||
Line 469: | Line 469: | ||
In fact, modern versions of **// | In fact, modern versions of **// | ||
as the one shipped with Slackware, do feature a | as the one shipped with Slackware, do feature a | ||
- | **back** function via the < | + | **back** function via the <key>'b'</ |
key. However, the function is only available when opening files | key. However, the function is only available when opening files | ||
directly in **// | directly in **// | ||
Line 475: | Line 475: | ||
</ | </ | ||
- | |||
==== less ==== | ==== less ==== | ||
- | In order to address the short-comings of more, a new pager was developed and ironically dubbed less(1). less is a very powerful pager that supports all of the functions of more while adding lots of additional features. To begin with, less allows you to use your arrow keys to control movement within the document. | + | In order to address the short-comings of |
+ | **//more//**, a new pager was developed and | ||
+ | ironically dubbed | ||
+ | **//less//** is a very powerful pager that | ||
+ | supports all of the functions of **//more//** | ||
+ | while adding lots of additional features. | ||
+ | **//less//** allows you to use your arrow keys to | ||
+ | control movement within the document. | ||
- | Due to its popularity, many Linux distributions have begun to exclude more in favor of less. Slackware includes both. Moreover, Slackware also includes a handy little pre-processor for less called lesspipe.sh. This allows a user to exectute less on a number of non-text files. lesspipe.sh will generate text output from running a command on these files, and display it in less. | ||
- | Less provides nearly as much functionality as one might expect from a text editor without actually being a text editor. Movement line-by-line can be done vi-style with **j** and **k**, or with the arrow keys, or **ENTER**. In the event that a file is too wide to fit on one screen, you can even scroll horizontally with the left and right arrow keys. The g key takes you to the top of the file, while G takes you to the end. | + | Due to its popularity, many Linux distributions have begun to |
+ | exclude | ||
+ | **//less//**. Slackware includes both. | ||
+ | Moreover, Slackware also includes a handy little pre-processor for | ||
+ | **//less//** called | ||
+ | '' | ||
+ | **// | ||
+ | '' | ||
+ | running a command on these files, and display it in | ||
+ | **// | ||
- | Searching is done as with more, by typing the / key and then your search string, but notice how the search results are highlighted for you, and typing n will take you to the next occurence of the result while N takes you to the previous occurrence. | ||
- | Also as with more, files maybe opened directly in less or piped to it: | + | **// |
+ | functionality as one might expect from a text editor without | ||
+ | actually being a text editor. Movement line-by-line can be done | ||
+ | **// | ||
+ | < | ||
+ | < | ||
+ | on one screen, you can even scroll horizontally with the left and | ||
+ | right arrow keys. The < | ||
+ | the file, while < | ||
+ | end. | ||
- | darkstar: | ||
- | / | ||
- | darkstar: | ||
- | / | ||
- | / | ||
- | There is much more to less; from within the application, | + | Searching |
+ | the / key and then your search string, but notice how the search | ||
+ | results are highlighted | ||
+ | take you to the next occurrence | ||
+ | < | ||
+ | |||
+ | Also as with **// | ||
+ | directly in **// | ||
+ | |||
+ | |||
+ | < | ||
+ | |||
+ | darkstar: | ||
+ | / | ||
+ | darkstar: | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | |||
+ | There is much more to **// | ||
+ | the application, | ||
+ | commands. | ||
===== Linking ===== | ===== Linking ===== | ||
- | Links are a method of referring to one file by more than one name. By using the ln(1) application, | + | Links are a method of referring to one file by more than one name. By |
+ | using the **//ln//**(1) application, | ||
+ | reference one file with more than one name. The two files are not | ||
+ | carbon-copies of one another, but rather are the exact same file, just | ||
+ | with a different name. To remove the file entirely, all of its names | ||
+ | must be deleted. | ||
+ | **//rm//** and other tools like it work. Rather | ||
+ | than remove the contents of the file, they simply remove the reference | ||
+ | to the file, freeing that space to be re-used. | ||
+ | **//ln//** will create a second reference or " | ||
+ | to that file.) | ||
- | darkstar:~$ ln / | ||
- | darkstar:~$ cat foo | ||
- | Slackware 12.0.0 | ||
- | darkstar:~$ ls -l / | ||
- | -rw-r--r-- 1 root root 17 2007-06-10 02:23 / | ||
- | -rw-r--r-- 1 root root 17 2007-06-10 02:23 foo | ||
- | Another type of link exists, the symlink. Symlinks, rather than being another reference to the same file, are actually a special kind of file in their own right. These symlinks point to another file or directory. The primary advantage of symlinks is that they can refer to directories as well as files, and they can span multiple filesystems. These are created with the [-s] argument. | + | < |
+ | darkstar:~$ ln / | ||
+ | darkstar:~$ cat foo | ||
+ | Slackware 14.0 | ||
+ | darkstar:~$ ls -l / | ||
+ | -rw-r--r-- 1 root root 17 2007-06-10 02:23 / | ||
+ | -rw-r--r-- 1 root root 17 2007-06-10 02:23 foo | ||
+ | </ | ||
- | darkstar:~$ ln -s / | ||
- | darkstar:~$ cat foo | ||
- | Slackware 12.0.0 | ||
- | darkstar:~$ ls -l / | ||
- | -rw-r--r-- 1 root root 17 2007-06-10 02:23 / | ||
- | lrwxrwxrwx 1 root root 22 2008-01-25 04:16 foo -> / | ||
- | When using symlinks, remember that if the original | + | Another type of link exists, the symlink. |
+ | another reference to the same file, are actually | ||
+ | in their own right. | ||
+ | The primary advantage of symlinks is that they can refer to directories | ||
+ | as well as files, and they can span multiple filesystems. | ||
+ | created with the //-s// argument. | ||
+ | |||
+ | |||
+ | < | ||
+ | darkstar:~$ ln -s / | ||
+ | darkstar:~$ cat foo | ||
+ | Slackware 140 | ||
+ | darkstar:~$ ls -l / | ||
+ | -rw-r--r-- 1 root root 17 2007-06-10 02:23 / | ||
+ | lrwxrwxrwx 1 root root 22 2008-01-25 04:16 foo -> / | ||
+ | </ | ||
- | ---- | + | When using symlinks, remember that if the original file is deleted, |
+ | your symlink is useless; it simply points at a file that doesn' | ||
+ | anymore. | ||
+ | ====== Chapter Navigation ====== | ||
**Previous Chapter: [[slackbook: | **Previous Chapter: [[slackbook: | ||
Line 525: | Line 588: | ||
====== 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! --> | ||
- | * Originally written by Alan Hicks, Chris Lumens, David Cantrell, Logan Johnson | + | |
<!-- * Contrbutions by [[wiki: | <!-- * Contrbutions by [[wiki: | ||