Bash Commands: Unterschied zwischen den Versionen

Aus Open Source Ecology - Germany
Zur Navigation springen Zur Suche springen
(Hilfe:Kategorisieren von Seiten: Kategorie: -OSEG 301 - IT Administration entfernt; Kategorie: OSEG - IT Administration hinzugefügt mittels HotCat-Helferlein (s. Benutzereinstellungen); +synaxhighlighting)
(→‎Chmod Calculator: added section from https://wiki.opensourceecology.de/index.php?title=Chmod&oldid=8035)
 
Zeile 25: Zeile 25:
 
</source>
 
</source>
  
==File Manager==
+
==File Management==
 
<source lang="bash">
 
<source lang="bash">
 
gksudo nautilus # (start it as root)
 
gksudo nautilus # (start it as root)
 
</source>
 
</source>
  
==Text==
+
===Text Search===
 
Search text in files:
 
Search text in files:
 
<source lang="bash">
 
<source lang="bash">
Zeile 36: Zeile 36:
 
</source>
 
</source>
  
== Find ==
+
=== Find ===
  
 
<source lang="bash">
 
<source lang="bash">
Zeile 44: Zeile 44:
 
find <dir> -name <filename>  
 
find <dir> -name <filename>  
 
</source>
 
</source>
 +
 +
=== Chmod Calculator{{anchor|chmod calculator}}===
 +
 +
Set rights with <code>chmod</code>, e.g add executable rights <code>chmod u+x myscript.sh</code>.
 +
 +
See also http://www.onlineconversion.com/html_chmod_calculator.htm for setting rights numerically.
  
 
== User Management ==
 
== User Management ==

Aktuelle Version vom 5. April 2018, 14:27 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 Management

gksudo nautilus # (start it as root)

Text Search

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>

Chmod Calculator

Set rights with chmod, e.g add executable rights chmod u+x myscript.sh.

See also http://www.onlineconversion.com/html_chmod_calculator.htm for setting rights numerically.

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