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
Q

output last x lines of file

A

tail -n x <file></file>

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

output first x lines of file

A

head -n x <file></file>

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

see all iepcs connected to tinycray

A

iepc watch / watchServer

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

show alle devices connected to CPU

A

lspci

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

show all files with names containing “string” in current folder + subfolders

A

find . -name “string

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

in Zwischenablage kopieren

A

| cb

cb

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

Task-Manager öffnen

A

top

32
Q

pipe something to kate in a new file

A

| kate -i

kate -i

33
Q

kill hard

A

kill -9

34
Q

copy

A

cp “source” “destination”

35
Q

move

A

mv “source” “destination”

36
Q

change user

A

su “username”

37
Q

show process ID

A

pidof “processname”

38
Q

print working directory

A

pwd

39
Q

open in background

A

… &

40
Q

kill process by name

A

killall (-9) “process name”

41
Q

open file with default program

A

xdg-open “filename”

42
Q

show all USB devices

A

lsusb

43
Q

show file type

A

file “filename”

44
Q

show calendar

A

cal

45
Q

output date and time

A

date

46
Q

copy/paste in terminal

A

ctrl + shift + c/v

47
Q

replace string1 with string2 in file1

A

sed -i ‘s/string1/string2/g’ file1

48
Q

show files in current directory

A

ls/dir

49
Q

change directory

A

cd

50
Q

show manual for command

A

man/info

51
Q

create directory

A

mkdir

52
Q

remove directory

A

rmdir / rm -r

53
Q

clear bash window

A

clear

54
Q

remove file

A

rm “filepath”

55
Q

run bash script

A

bash “script name”

56
Q

return error code of previous command

A

echo $? (1: error, 0: success)

57
Q

show last commands

A

history

58
Q

show path to binary of command

A

which “command name”

59
Q

redirect to deletion

A

> /dev/null

60
Q

redirect stdout

A

1>

61
Q

get version of installed program

A

rpm -q “program name”

62
Q

show available linux repos

A

sudo zypper refresh

63
Q

show available updates

A

sudo zypper lu

64
Q

debug in console

A

cd ~/dev/build/Debug
make install -j 1

65
Q

show only meas for sub tpt in parse

A

parse split “no of sub TPTs” “subTPT index”

66
Q

show what an alias or builtin stands for

A

type “alias or builtin”

67
Q

show all aliases

A

compgen -a

68
Q

get PID of running bash script

A

ps aux | grep “bash script name”

69
Q

show all processes

A

ps

70
Q

what should you do before searching for a package in zypper?

A

run sudo zypper refresh

71
Q

use awk to get file path from line: “! “file_path””

A

awk ‘{print $2}’

72
Q

where does find the bash_functions help?

A

isios_help

73
Q

grep option for case insensitive

A

-i

74
Q

turn color back to black when red

A

reset

75
Q

get size of directory

A

du -sh “directory name”