Skip to content

Latest commit

 

History

History
810 lines (607 loc) · 22.9 KB

home-cli.md

File metadata and controls

810 lines (607 loc) · 22.9 KB

home seiten a-z <-- hoch --> runter home/cli

CLI - Command Line Interface

Bourne shell syntax. Bourne-compatible shells: sh, bash, zsh and ksh

Befehle

Befehl Anmerkung
ls ls: 'list'
alias
unalias
pwd pwd: 'print working directory'
cd cd: 'change directory'
cp cp: 'copy'
rm rm: 'remove directory'
mv mv: 'move'
mkdir mkdir: 'make directory'
man man: 'manual'
touch
chmod chmod: 'change mode'
./ ./: 'run program'
exit
sudo sudo: 'superuser do'
shutdown
htop
unzip
apt
echo
cat cat: 'concatenate'
ps
kill
ping
vim Open Source Terminal-Texteditor
history
passwd passwd: 'password'
which
shred
less
tail
head
grep
whoami whoami: 'who am i'
whatis
wc wc: 'word count'
uname uname: 'unix name'
neofetch
find
wget wget: 'world wide web get' Ein Dienstprogramm zum Abrufen von Inhalten aus dem Internet.

General Tools

Befehl Anmerkung
bc bc: 'basic calculator' Performs floating point math and various other useful calculations that are not practical with basic shell math support.
expect Used to work with hard-to-handle command-line tools that require more complex interaction than is possible with a single pipe. For example, you could use an expect script to interact with getty over a tty or other bidirectional connection to log into a remote computer. In general, scripting that requires two-way interaction between the script and a program is most easily done with an expect script.
expr Evaluates a numerical expression. This command supports basic integer math, and is frequently used for incrementing a loop iterator.
false Returns a failure exit status (nonzero).
sleep Pauses execution for a period of time (measured in seconds).
true Returns a successful exit status (0).

Text processing Tools

Befehl Anmerkung
awk Short for Aho, Weinberger, and Kernighan; a programming language in itself, used for text processing using regular expressions. This tool is described further in How AWK-ward.
grep Short for Global [search for] Regular Expressions and Print; prints lines matching an input pattern (optionally with a specified number of lines of leading and/or trailing context). The grep command can take input from standard input or from files.Common variants include agrep (“approximate grep” from the Univ. of AZ), fgrep, and egrep.
head Prints the first few lines from a file (or standard input). The number of lines can be specified with the -n flag.
perl A programming language whose scripts can be easily embedded in shell scripts using the -e flag. Perl's regular expression language is somewhat richer than basic regular expressions (and easier to read than character classes in extended regular expressions), making it popular for text processing use.
sed Short for stream editor; performs more complex text substitutions using regular expressions.
sort Sorts a series of lines. By default, sort reads these lines from its standard input. After its standard input is closed, it sorts them and prints the results to its standard output.
tail Prints the last few lines from of a file (or standard input). The number of lines can be specified with the -n flag. Alternatively, you can specify the starting position as a byte or line offset from either the start or end of the file.
tee Copies standard input to standard output, saving a copy into a file (or multiple files).
tr Replaces one character with another.
uniq Filters out adjacent lines that match.

File Commands

Befehl Anmerkung
cd Changes the current working directory. The command cd .. moves up a directory, for example.
chflags Changes flags on a file or directory. Most of these flags are relatively obscure. For changing permissions flags, use chmod instead.
chgrp Changes the group ID associated with a file or directory.
chmod Changes modes (permission bits) or access control lists (ACLs) on a file or directory.
chown Changes the ownership of files or directories. This command can also change the group if desired.
find Lists or searches for files in a directory and its subdirectories.
ln Creates symbolic links and hard links to files or directories.
ls Lists the files in the current directory.
mkdir Creates new directories.
mkfifo Creates named pipes for communication. This tool is useful in situations where pipes cannot be established while executing the commands, such as connecting two tools in a circular fashion.
mv Moves or renames files and directories.
rm rmdir Removes files and directories
stat Prints detailed file status information, such as the type of file, last modification date, and so on.
GetFileInfo SetFile These tools, installed as part of the Developer Tools installation, are useful for getting and manipulating things like extended attributes.Be aware that if you write a script that depends on these, it will require the Developer Tools to be installed.

Disk Commands

Befehl Anmerkung
diskutil Mounts and unmounts volumes and disks, checks disks for consistency, erases optical disks, wipes disks with a security wipe, partitions disks, manipulates RAID sets, and so on.This utility is the command-line counterpart to the Disk Utility application.
fsck fsck_msdos fsck_hfs Checks a file system for consistency.
hdiutil Creates and manipulates disk images, including attaching disk images for mounting.
mount umount mount_afp mount_cd9660 mount_cddafs mount_fdesc mount_ftp mount_hfs mount_msdos mount_nfs mount_ntfs mount_smbfs mount_udf mount_url mount_webdav Mounts and unmounts volumes.If you unmount automounted volumes behind the back of the disk arbitration system, you can cause strange behavior in the GUI. Use these commands with care, and if you are trying to unmount an automounted volume, use hdiutil or diskutil instead.

Archiving and Compression Commands

Befehl Anmerkung
bzip2 bunzip2 bzip2recover Compresses and decompresses files using the Burrows-Wheeler block sorting text compression algorithm and Huffman coding. This compression tool takes somewhat longer than other tools such as gzip, but tends to result in smaller files, and is thus growing in popularity for distributing large files.Files created with this tool end with the .bz2 extension.
compress uncompress Compresses and decompresses files using the Lempel-Ziv-Welsh (LZW) compression algorithm. This compression format has largely fallen out of popularity.Files created by this tool end with the .Z extension.
gzip gunzip zcat gzcat Compresses, uncompresses, and prints the contents of files in the GNU Zip (LZ77-based) format. This compression scheme is popular with UNIX and Linux users.While based on the same underlying compression scheme, the GNU Zip and ZIP file formats are not the same. The ZIP file format can contain multiple files, while the Gzip file format can only contain a single file (though this single file may be a tar archive).Files created by this tool end with the .gz extension.
zip unzip funzip Compresses and uncompresses files and directories using the ZIP file format (deflate, based on LZ77 and Huffman coding). This file format is commonly used for exchanging compressed files with Windows users.Files created by this tool end with the .zip extension.
tar Creates, appends to, and extracts multifile archives in the tar (short for “Tape ARchive”) format. This format is the standard format for storing multiple files in a single archive among UNIX and Linux users. The tar file format is usually seen in a compressed form, using either gzip or bzip2.Files created by this tool end with the .tar extension (or the .tgz or .tbz extensions for tar archives compressed with gzip or bzip2).

xxx

awk

bc bzip2 bunzip2 bzip2recover

cd chflags chgrp chmod chown compress

diskutil

expect expr

false find fsck fsck_msdos fsck_hfs funzip

GetFileInfo grep gunzip gzcat gzip

hdiutil head

ln ls

mkdir mkfifo mount umount mount_afp mount_cd9660 mount_cddafs mount_fdesc mount_ftp mount_hfs mount_msdos mount_nfs mount_ntfs mount_smbfs mount_udf mount_url mount_webdav mv

perl

rm rmdir

sed SetFile sleep sort stat

tail tar tee tr true

uncompress uniq
unzip

zcat zip

General Tools

bc expect expr false sleep true

Text processing Tools

awk grep head perl sed sort tail tee tr uniq

File Commands

cd chflags chgrp chmod chown find ln ls mkdir mkfifo mv rm rmdir stat GetFileInfo SetFile

Disk Commands

diskutil fsck fsck_msdos fsck_hfs hdiutil mount umount mount_afp mount_cd9660 mount_cddafs mount_fdesc mount_ftp mount_hfs mount_msdos mount_nfs mount_ntfs mount_smbfs mount_udf mount_url mount_webdav

Archiving and Compression Commands

bzip2 bunzip2 bzip2recover compress uncompress gzip gunzip zcat gzcat zip unzip funzip tar

Inhalt

alias

Text ...

> alias
run-help=man
which-command=whence

details rauf runter


apt

Text ...

details rauf runter


cat

Text ...

details rauf runter


cd

Text ...

details rauf runter


chmod

Text ...

details rauf runter


cp

Text ...

details rauf runter


echo

Text ...

details rauf runter


exit

Text ...

details rauf runter


find

Text ...

details rauf runter


grep

Text ...

details rauf runter


head

Text ...

details rauf runter


history

Text ...

details rauf runter


htop

Text ...

details rauf runter


kill

Text ...

details rauf runter


less

Text ...

details rauf runter


ls

Text ...

details rauf runter


man

Text ...

details rauf runter


mkdir

Text ...

details rauf runter


mv

Text ...

details rauf runter


neofetch

Text ...

details rauf runter


passwd

Text ...

details rauf runter


ping

Text ...

details rauf runter


ps

Text ...

details rauf runter


pwd

Text ...

details rauf runter


rm

Text ...

details rauf runter


shred

Text ...

details rauf runter


shutdown

Text ...

details rauf runter


sudo

Text ...

details rauf runter


tail

Text ...

details rauf runter


touch

Text ...

details rauf runter


unalias

Text ...

details rauf runter


uname

Text ...

details rauf runter


unzip

Text ...

details rauf runter


vim

Text ...

details rauf runter


wc

Text ...

details rauf runter


wget

Text ...

details rauf runter


whatis

Text ...

details rauf runter


which

Text ...

details rauf runter


whoami

Text ...

details rauf runter


./

Text ...

details rauf runter


Links:

Die 40 meist genutzten Linux-Befehle, die du kennen solltest von Daniel Diaz, 2023
Kommandozeile (Command Line Interface, CLI) von Peter Loshin, 2022 Shell Scripting Primer von apple


home seiten a-z <-- hoch --> rauf