Beruflich Dokumente
Kultur Dokumente
ls -a --- lists all files, including the ones whose filenames begin in a dot
4. rm filename --- removes a file. It is wise to use the option rm -i, which will ask you for
confirmation before actually deleting anything
5. diff filename1 filename2 --- compares files, and shows where they differ
6. chmod options filename --- lets you change the read, write, and execute
permissions on your files. For example, chmod o+r filename will make the
file readable for everyone, and chmod o-r filename will make it unreadable
for others again
7. gzip filename --- compresses files, Gzip produces files with the ending '.gz'
appended to the original filename.
10. tar
Use create compressed archives of directories and files, and also to extract directories and
files from an archive. Example:
ncftp
Use ncftp for anonymous ftp --- that means you don't have to have a password.
% ncftp ftp.fubar.net
Connected to ftp.fubar.net
> get jokes.txt
rsh
Use this command if you want to work on a computer different from the one you are
currently working on. One reason to do this is that the remote machine might be faster.
For example, the command
% rsh solitude
more
More is a command used to read text files. For example, we could do this:
% more poems
The effect of this to let you read the file "poems ". It probably will not fit in one screen,
so you need to know how to "turn pages". Here are the basic commands:
head /Tail
% head -n 20 essay.001
% tail -n 20 essay.001
-c, --bytes
printing
12. lpr filename --- print. Use the -P option to specify the printer name if you want to use a
printer other than your default printer. For example, if you want to print double-sided, use
'lpr -Pvalkyr-d
13. lpq --- check out the printer queue, e.g. to get the number needed for removal, or to see
how many other files will be printed before yours will come out
14. lprm jobnumber --- remove something from the printer queue. You can find the job
number by using lpq. Theoretically you also have to specify a printer name, but this isn't
necessary as long as you use your default printer in the department.
15. genscript --- converts plain text files into postscript for printing, and gives you some
options for formatting. Consider making an alias like alias ecop 'genscript -2 -r \!* | lpr
-h -Pvalkyr' to print two pages on one piece of paper.
19. tar: "Tape Archiver"; bundles a collection of files into one unit ("tarfile") for
archiving or transmitting
usage: tar [options][tarfile][files]
options: see manpage
example: tar cf - . | gzip -c > test.tar.gz--bundles everything in the current
directory, compresses it with gzip, creating a file called test.tar.gz
example: tar xvf files.tar--extracts files fromfiles.tar
22. mv: Move file under a directory structure or to new file name; original
(source) file will be gone
usage: mv [file] [dir]--moves file under existing directory dir
options: -f force copy over any existing file by that name | -i prompts user to
copy over files
example: mv temp.txt dir/ --moves temp.txt into directory dir/
example: mv -f temp.txt dir/ --moves temp.txt into directory dir/ erasing old
temp.txt if it exists
example: mv -i temp.txt dir/ --moves temp.txt into directory dir/ but asking
before overwriting old temp.txt if it exists
24. lpstat: Gives status of print jobs generated via the lp command
usage: lpstat [options]
options: see manpage
example: lpstat -pnohole--gives printer status of nohole print queue
25. history: Displays a chronologic list of the last n commands you've entered
usage: history to display history
usage: !! to recall last command (can be used for re-execution of command)
options: see manpage
example: set history=100--to save a stack of 100 commands
34.
- Symbolizes stdin
usage: - when used as input path, specifies that input will come from stdin which is the
keyboard
options: none
example: cat - > newfile--whatever you enter from keyboard will be used as input to create the
new file newfile
example: gunzip -c file.tgz | tar xf - --unzip file.tgz to stdout and send it to stdin of tar
1.
| (pipe) Route output of command to the left of it to input of the command to the right of
it
usage: | followed by a second process
options: none
example: $who | wc -l--count the number of users on the system
example: ls | more--list files in current directory and display them one page at a time
("pipe stdout to more)
Suspend
To suspend a background process, you must know its job number. For example,
to suspend background job 2, type:
% stop %2
% bg %2
% fg %1
• You can also resume suspended processes by just typing a percent sign (%)
followed by the job number. For example, the command %1 would resume job
1 in the foreground. This command:
% %2&