Bash Commands: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(→Find) |
(Hilfe:Kategorisieren von Seiten: Kategorie: -OSEG 301 - IT Administration entfernt; Kategorie: OSEG - IT Administration hinzugefügt mittels HotCat-Helferlein (s. Benutzereinstellungen); +synaxhighlighting) |
||
Zeile 1: | Zeile 1: | ||
+ | See also https://biowikifarm.net/meta/Selected_Linux_commands | ||
+ | |||
+ | == Get help == | ||
+ | <source lang="bash"> | ||
+ | apropos ftp # searches for all program descriptions with ftp | ||
+ | man 7z # manual page for 7z | ||
+ | # shift + ? → searching a string (by regular expression) | ||
+ | # shift + n/n → find the next/previous match | ||
+ | # q → quit | ||
+ | </source> | ||
+ | Most commands provide a help option and the following works: | ||
+ | <source lang="bash" style="margin-left:1.5em;border:0px none;padding:0px;"> | ||
+ | a-command --help | ||
+ | a-command -h | ||
+ | # sometimes there is an info on usage | ||
+ | a-command --usage | ||
+ | </source> | ||
+ | |||
==Internet== | ==Internet== | ||
− | + | ||
− | + | <source lang="bash"> | |
+ | # Download the given file and overwrites the local one according to the file’s timestamp | ||
+ | wget --timestamping http://... | ||
+ | wget -N http://... | ||
+ | </source> | ||
==File Manager== | ==File Manager== | ||
− | + | <source lang="bash"> | |
+ | gksudo nautilus # (start it as root) | ||
+ | </source> | ||
==Text== | ==Text== | ||
Search text in files: | Search text in files: | ||
− | + | <source lang="bash"> | |
+ | grep -r "your text" <directory> | ||
+ | </source> | ||
== Find == | == Find == | ||
− | + | ||
− | + | <source lang="bash"> | |
+ | # print the path of the executable file | ||
+ | which <executable> | ||
+ | # search for a file or directory with the given filename | ||
+ | find <dir> -name <filename> | ||
+ | </source> | ||
== User Management == | == User Management == | ||
+ | === Add a User === | ||
− | = | + | <source lang="bash"> |
+ | sudo adduser <username> | ||
+ | </source> | ||
− | + | ==Unzip== | |
− | = | + | <source lang="bash"> |
− | + | tar -xzf <filename>.gz | |
+ | tar --extract --gzip --file=<filename>.gz | ||
+ | </source> | ||
==Cron Jobs== | ==Cron Jobs== | ||
− | + | ||
− | + | <source lang="bash"> | |
+ | # run with -s (shell environment variables) | ||
+ | sudo -s <command> | ||
+ | sudo -s crontab -e # crontab -e: edit crontab jobs to add or remove cron jobs | ||
+ | </source> | ||
+ | |||
http://www.sysadminslife.com/linux/cronjob-unter-debian-und-ubuntu-erstellen/ | http://www.sysadminslife.com/linux/cronjob-unter-debian-und-ubuntu-erstellen/ | ||
==Create Screens== | ==Create Screens== | ||
− | + | ||
− | + | <source lang="bash"> | |
+ | screen # saves your screen even after session time out | ||
+ | screen -r # resumes a detached screen session | ||
+ | </source> | ||
* Ctrl+AC (create new terminal tab) | * Ctrl+AC (create new terminal tab) | ||
− | + | * Ctrl+AA (switch between terminal tabs) | |
+ | |||
==Backup== | ==Backup== | ||
Zeile 38: | Zeile 83: | ||
==Shutdown== | ==Shutdown== | ||
− | + | ||
+ | <source lang="bash"> | ||
+ | sudo shutdown -h 18:45 # at 18 o’clck 45min | ||
+ | </source> | ||
[[Category: Software]] | [[Category: Software]] | ||
− | [[Category: | + | [[Category:OSEG - IT Administration]] |
Version vom 5. April 2018, 14:18 Uhr
See also https://biowikifarm.net/meta/Selected_Linux_commands
Get help
apropos ftp # searches for all program descriptions with ftp
man 7z # manual page for 7z
# shift + ? → searching a string (by regular expression)
# shift + n/n → find the next/previous match
# q → quit
Most commands provide a help option and the following works:
a-command --help
a-command -h
# sometimes there is an info on usage
a-command --usage
Internet
# Download the given file and overwrites the local one according to the file’s timestamp
wget --timestamping http://...
wget -N http://...
File Manager
gksudo nautilus # (start it as root)
Text
Search text in files:
grep -r "your text" <directory>
Find
# print the path of the executable file
which <executable>
# search for a file or directory with the given filename
find <dir> -name <filename>
User Management
Add a User
sudo adduser <username>
Unzip
tar -xzf <filename>.gz
tar --extract --gzip --file=<filename>.gz
Cron Jobs
# run with -s (shell environment variables)
sudo -s <command>
sudo -s crontab -e # crontab -e: edit crontab jobs to add or remove cron jobs
http://www.sysadminslife.com/linux/cronjob-unter-debian-und-ubuntu-erstellen/
Create Screens
screen # saves your screen even after session time out
screen -r # resumes a detached screen session
- Ctrl+AC (create new terminal tab)
- Ctrl+AA (switch between terminal tabs)
Backup
- sudo ./backupAll.bash <backupname>
Shutdown
sudo shutdown -h 18:45 # at 18 o’clck 45min