Linux Command Line Befehle: Unterschied zwischen den Versionen
Gego (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
Gego (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 104: | Zeile 104: | ||
<code>tail -F file1 </code> Output last lines of file1 as it changes | <code>tail -F file1 </code> Output last lines of file1 as it changes | ||
==File Permissions== | |||
chmod 775 file Change mode of file to 775 | |||
chmod -R 600 folder Recursively chmod folder to 600 | |||
chown user:group file Change file owner to user and group to group | |||
==File Permission Numbers== | |||
First digit is owner permission, second is group and third is everyone. | |||
Calculate permission digits by adding numbers below. | |||
*4 read (r) | |||
*2 write (w) | |||
*1 execute (x) | |||
Version vom 28. September 2022, 18:44 Uhr
INFORMATION
Details: Siehe Volltext. Sprache der Inhalte: Deutsch.
- Linux Command Line FAQ
- ELib Team
- 2022 2022
- Siehe eLib.at Lizenz, so nicht extra anders angegeben.
- Graues Werk
- Onlineversion - Archivversion
Zitierhilfe: Zitiere diese Inhalte in verschiedenen Zitierstilen. Archivkopien aller Inhalte finden sich auch im großartigen Internet Archive (Spenden).
QUERVERBINDUNGEN
Verbindungen mit Personen, Orten, Dingen und Ereignissen finden sich unter Themen und Schwerpunkte.
TAGS & KATEGORIEN
Linux Command Line Befehle
System Care
sudo apt-get update
Update List of Packages
sudo apt-get upgrade
Upgrade OS and packages
Directory Operations
pwd
Show current directory
mkdir dir
Make directory dir
cd dir
Change directory to dir
cd ..
Go up a directory
ls
List files
ls Options
-a
Show all (including hidden)
-R
Recursive list
-r
Reverse order
-t
Sort by last modified
-S
Sort by file size
-l
Long listing format
-1
One file per line
-m
Comma-separated output
-Q
Quoted output
Search Files
grep pattern files
Search for pattern in files
grep -i
Case insensitive search
grep -r
Recursive search
grep -v
Inverted search
grep -o
Show matched part of file only
find /dir/ -name name*
Find files starting with name in dir
find /dir/ -user name
Find files owned by name in dir
find /dir/ -mmin num
Find files modifed less than num minutes ago in dir
whereis command
Find binary / source / manual for command
locate file
Find file (quick search of system index)
File Operations
touch file1
Create file1
cat file1 file2
Concatenate files and output
less file1
View and paginate file1
file file1
Get type of file1
cp file1 file2
Copy file1 to file2
mv file1 file2
Move file1 to file2
rm file1
Delete file1
head file1
Show first 10 lines of file1
tail file1
Show last 10 lines of file1
tail -F file1
Output last lines of file1 as it changes
File Permissions
chmod 775 file Change mode of file to 775
chmod -R 600 folder Recursively chmod folder to 600
chown user:group file Change file owner to user and group to group
File Permission Numbers
First digit is owner permission, second is group and third is everyone.
Calculate permission digits by adding numbers below.
- 4 read (r)
- 2 write (w)
- 1 execute (x)
Nano Shortcuts
Files
Ctrl-R
Read file
Ctrl-O
Save file
Ctrl-X
Close file
Cut and Paste
ALT-A
Start marking text
CTRL-K
Cut marked text or line
CTRL-U
Paste text
ALT-/
End of file
CTRL-A
Beginning of line
CTRL-E
End of line
CTRL-C
Show line number
CTRL-_
Go to line number
Search File
CTRL-W
Find
ALT-W
Find next
CTRL-\
Search and replace
More nano info at: http://www.nano-editor.org/docs.php
Screen Shortcuts
screen
Start a screen session.
screen -r
Resume a screen session.
screen -list
Show your current screen sessions.
CTRL-A
Activate commands for screen.
CTRL-A c
Create a new instance of terminal.
CTRL-A n
Go to the next instance of terminal.
CTRL-A p
Go to the previous instance of terminal.
CTRL-A "
Show current instances of terminals.
CTRL-A A
Rename the current instance.
More screen info at: http://www.gnu.org/software/screen/
Bash Commands
uname -a
Show system and kernel
head -n1 /etc/issue
Show distribution
mount
Show mounted filesystems
date
Show system date
uptime
Show uptime
whoami
Show your username
man command
Show manual for command
Bash Shortcuts
CTRL-c
Stop current command
CTRL-z
Sleep program
CTRL-a
Go to start of line
CTRL-e
Go to end of line
CTRL-u
Cut from start of line
CTRL-k
Cut to end of line
CTRL-r
Search history
!!
Repeat last command
!abc
Run last command starting with abc
!abc:p
Print last command starting with abc
!$
Last argument of previous command
ALT-.
Last argument of previous command
!*
All arguments of previous command
^abc^123
Run previous command, replacing abc with 123
Bash Variables
env
Show environment variables
echo $NAME
Output value of $NAME variable
export NAME=value
Set $NAME to value
$PATH
Executable search path
$HOME
Home directory
$SHELL
Current shell
Links
.
Endnoten