Standard Bash functions Flashcards

1
Q

modify permissions

A

chmod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

add execution permission

A

chmod +x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

show username

A

whoami

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

show ip configuration

A

ip addr/ifconfig

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

get updates

A

sudo zypper update

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

install program

A

sudo zypper in <program></program>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

search for program to install

A

sudo zypper se <keyword></keyword>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

show relevant commands for keyword

A

apropos <keyword></keyword>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

redirect standard output and overwrite existing file

A

> /1>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

command: >

A

redirect standard output and overwrite existing file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

redirect standard input and overwrite existing file

A

0>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

redirect stdout and append to file

A

> >

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

output list of measurement joint poses

A

parse jp <series></series>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

output list of measurement tracker values

A

parse tv <series></series>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

show all IPs in network

A

sudo nmap -sn 192.168.0.0/24

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

see if IP can be found in network

A

ping <IP></IP>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

show all open files

A

lsof (remember, that everything is a file in Linux)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

filter output of command for certain string

A

| grep <string></string>

grep <string></string>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

redirect standard error to file

A

2>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

command: 2>

A

redirect standard error to file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

get version of installed program

A

rpm -q <program></program>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

ignore output of command

A

> /dev/null

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

output string to console

A

echo “<string>"</string>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

output content of file

A

cat <file></file>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
output last x lines of file
tail -n x
26
output first x lines of file
head -n x
27
see all iepcs connected to tinycray
iepc watch / watchServer
28
show alle devices connected to CPU
lspci
29
show all files with names containing "string" in current folder + subfolders
find . -name "*string*"
30
in Zwischenablage kopieren
| cb | cb
31
Task-Manager öffnen
top
32
pipe something to kate in a new file
| kate -i | kate -i
33
kill hard
kill -9
34
copy
cp "source" "destination"
35
move
mv "source" "destination"
36
change user
su "username"
37
show process ID
pidof "processname"
38
print working directory
pwd
39
open in background
... &
40
kill process by name
killall (-9) "process name"
41
open file with default program
xdg-open "filename"
42
show all USB devices
lsusb
43
show file type
file "filename"
44
show calendar
cal
45
output date and time
date
46
copy/paste in terminal
ctrl + shift + c/v
47
replace string1 with string2 in file1
sed -i 's/string1/string2/g' file1
48
show files in current directory
ls/dir
49
change directory
cd
50
show manual for command
man/info
51
create directory
mkdir
52
remove directory
rmdir / rm -r
53
clear bash window
clear
54
remove file
rm "filepath"
55
run bash script
bash "script name"
56
return error code of previous command
echo $? (1: error, 0: success)
57
show last commands
history
58
show path to binary of command
which "command name"
59
redirect to deletion
> /dev/null
60
redirect stdout
1>
61
get version of installed program
rpm -q "program name"
62
show available linux repos
sudo zypper refresh
63
show available updates
sudo zypper lu
64
debug in console
cd ~/dev/build/Debug make install -j 1
65
show only meas for sub tpt in parse
| parse split "no of sub TPTs" "subTPT index"
66
show what an alias or builtin stands for
type "alias or builtin"
67
show all aliases
compgen -a
68
get PID of running bash script
ps aux | grep "bash script name"
69
show all processes
ps
70
what should you do before searching for a package in zypper?
run sudo zypper refresh
71
use awk to get file path from line: "! "file_path""
awk '{print $2}'
72
where does find the bash_functions help?
isios_help
73
grep option for case insensitive
-i
74
turn color back to black when red
reset
75
get size of directory
du -sh "directory name"