Standard Bash functions Flashcards
modify permissions
chmod
add execution permission
chmod +x
show username
whoami
show ip configuration
ip addr/ifconfig
get updates
sudo zypper update
install program
sudo zypper in <program></program>
search for program to install
sudo zypper se <keyword></keyword>
show relevant commands for keyword
apropos <keyword></keyword>
redirect standard output and overwrite existing file
> /1>
command: >
redirect standard output and overwrite existing file
redirect standard input and overwrite existing file
0>
redirect stdout and append to file
> >
output list of measurement joint poses
parse jp <series></series>
output list of measurement tracker values
parse tv <series></series>
show all IPs in network
sudo nmap -sn 192.168.0.0/24
see if IP can be found in network
ping <IP></IP>
show all open files
lsof (remember, that everything is a file in Linux)
filter output of command for certain string
| grep <string></string>
grep <string></string>
redirect standard error to file
2>
command: 2>
redirect standard error to file
get version of installed program
rpm -q <program></program>
ignore output of command
> /dev/null
output string to console
echo “<string>"</string>
output content of file
cat <file></file>
output last x lines of file
tail -n x <file></file>
output first x lines of file
head -n x <file></file>
see all iepcs connected to tinycray
iepc watch / watchServer
show alle devices connected to CPU
lspci
show all files with names containing “string” in current folder + subfolders
find . -name “string”
in Zwischenablage kopieren
| cb
cb
Task-Manager öffnen
top
pipe something to kate in a new file
| kate -i
kate -i
kill hard
kill -9
copy
cp “source” “destination”
move
mv “source” “destination”
change user
su “username”
show process ID
pidof “processname”
print working directory
pwd
open in background
… &
kill process by name
killall (-9) “process name”
open file with default program
xdg-open “filename”
show all USB devices
lsusb
show file type
file “filename”
show calendar
cal
output date and time
date
copy/paste in terminal
ctrl + shift + c/v
replace string1 with string2 in file1
sed -i ‘s/string1/string2/g’ file1
show files in current directory
ls/dir
change directory
cd
show manual for command
man/info
create directory
mkdir
remove directory
rmdir / rm -r
clear bash window
clear
remove file
rm “filepath”
run bash script
bash “script name”
return error code of previous command
echo $? (1: error, 0: success)
show last commands
history
show path to binary of command
which “command name”
redirect to deletion
> /dev/null
redirect stdout
1>
get version of installed program
rpm -q “program name”
show available linux repos
sudo zypper refresh
show available updates
sudo zypper lu
debug in console
cd ~/dev/build/Debug
make install -j 1
show only meas for sub tpt in parse
parse split “no of sub TPTs” “subTPT index”
show what an alias or builtin stands for
type “alias or builtin”
show all aliases
compgen -a
get PID of running bash script
ps aux | grep “bash script name”
show all processes
ps
what should you do before searching for a package in zypper?
run sudo zypper refresh
use awk to get file path from line: “! “file_path””
awk ‘{print $2}’
where does find the bash_functions help?
isios_help
grep option for case insensitive
-i
turn color back to black when red
reset
get size of directory
du -sh “directory name”