Linux Shell Cheatsheet Flashcards

1
Q
  1. General: Unix file layout
A

the tree-like logical system layout that organizes and stores all files under directories. at the top of the system is the root, represented with /.

/bin/cp
/bin/is
/bin/pwd
/home/daniel/bin
/home/daniel/profile
etc
https://media.geeksforgeeks.org/wp-content/uploads/20221206120522/noname.png

tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
  1. General: * UTF
A

Unicode Transformation Format.
UTF-8: 9bit unicode conversion format.
UTF 65 = A
UTF 66 = B
etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  1. Install: sudo
A

super user do
gives admin/root access rights, applies root access to commands

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  1. Install: apt-get
A

command line tool for interacting with Advanced Package Tool (APT) Library. (package management system for Linux distributions)

allows you to search, install, manage, update and remove software.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  1. Install: install
A

copies files and sets file permissions.
install text.txt /target_directory
install -m 700 text.txt new_directory
(copies to new directory with rwx— permissions)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
  1. Processes: jobs
A

process managed by shell

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. Processes: ^Z/^C
A

^C kills current process,
^Z pauses the process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. Processes: bg/fg
A

fg continues process from the background,
bg continues process in background

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. Processes: &
A

sends the command to the background

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. Processes: kill
A

kills a process. can also kill [ID] to target which process to kill

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. Processes: killall
A

kills all processes in the background
killall sleep // kills all sleeps in the backgground

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. Processes: wait
A

wait() system call suspends execution of the calling thread until one of its children terminates.

or, waits for the completion of any running processes. if multiple processes are running, only uses the last known command’s process id.
wait PID // waits until PID process finishes

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

3.1: Processes: %n

A

brings the job at position n to the foreground

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

3.1: Processes: ps

A

abbreviates ‘process status’.

ises to list currently running processes and their PIDs along with other info

lists PIDs and

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

3.1: Processes: nice

A

lowers a process’s priority

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

3.1. Processes: time

A

checks how long a process takes to complete

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

3.1: Processes: htop

A

nicer view compared to top. shows active processes, the PIDs, and other info

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

3.1: Processes: top

A

shows active processes, their PIDs and other info. but not as pretty as htop.

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

3.1: Processes: watch

A

reruns commands in a loop until stopped manually, or runs into a condition that stops the loop.

helps monitor something until it changes.

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

3.2: Processes: /proc

A

pseudo-filesystem, provides an interface to kernel data structures. mostly read-only.

displays kernel/system state, but read-only

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

3.2: Processes: suspend

A

uh, CTRL+Z?
can be continued with bg or fg

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

3.2: Processes: Notify-Send

A

sends notifications, alternative to windows pop-ups.

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

3.2: Processes: * batch

A

telling the system to execute commands from a list or queue.

can be made to run at late night or early morning to free the system for interactive.

can also set batch process priority to when CPU is not busy. nice.

use queuedefs fo;e tp describe queues managed by cron daemon. letters between a and y define queue name. tasks started by the at command placed in default queue for a. batch-started commands are placed in b queue. c is for tasks from the crontab file.

batch command will execute commands from standard input or a specified fille when the system load levels drop to a specific point.

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

3.2: Processes: * at

A

creates a list of commands to be excecuted at a specified time

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

3.2: Processes: * atq

A

displays listed jobs to be executed

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

3.2: Processes: * crontab

A

chron table. lists jobs under cron command.

cron meaning the jobs will be executed automatically according to a set schedule

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

3.2: Processes: * ^Q/^S

A

^S - stops all output to the terminal(program will keep running) which can be restarted with ^q
^q - releases (displays) terminal output which has been paused with q.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q
  1. History: history n
A

outputs previous n commands to terminal

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

inputs the previous terminal input

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

s/old/new

A

replaces found instance of old with new

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

displays the 2nd previous command, and inputs it to the terminal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q
  1. !!:p
A

displays the previous terminal input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q
  1. Wild Cards & WS: *
A
  • represents any number of characters (even 0 characters).
    h*t = hat, hot, hoot, hlnjasjdnaisjnt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q
  1. Wild Cards & WS: ?
A

? represents any single character.
h?t = hat, hot, hit, but not hoot.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q
  1. Wild Cards & WS: |chroot
A

creates a new root directory
chroot [options] /path/to/new/root /path/to/server

mkdir $HOME/jail //creates jail
mkdir -p $HOME/jail/{bin, lib64} //create directories in jailus
cd $HOME/jail
cp -v /bin/{bash, ls} $HOME/jail/bin //copy /bash and /ls to fake home directory
ldd /bin/bash //print shared libraries
cp -v [whatever the displayed libraries are] $HOME/jail/lib64
sudo chroot $HOME/jail /bin/bash// user now treats /jail as root directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q
  1. Wild Cards & WS: “ “
A

preserves literal values except for $, `, “, \, and !.

\ only has speacial meaning whewn followed by $, `, “ \ or a newline character.

also guves * and @ meaning if introduces as $@ (passing specified parameters seperately)) or $* (passing all parameters as a single parameter).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q
  1. Wild Cards & WS: ‘ ‘
A

preserves the literal value of each character within the quotes.

echo !!
echo ‘!!’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q
  1. Wild Cards & WS: [A-Z]
A

specifies a range.

m[a,o,u]m becomes man, mom and mum.
m[a-d]m will include mam, mbm, mcm and mdm.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q
  1. Wild Cards & WS: {A..Z}
A

specifies a range seperated by commas.

m{a,o,u}m becomes man, mom and mum.
{*.doc, *.pdf} will include bob.doc, sam.doc, word.pdf, what.pdf

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q
  1. FS/*: mount
A

mount -t TYPE DEVICE DIR

attaches the file system found on some device to the file tree/file hierarchy of the unix system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q
  1. FS/*: umount
A

umount {directory|device}

removes the file system found on some device form the file tree/hierarchy of the unix system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q
  1. FS/*: {un}compress
A

sudo install ncompress

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q
  1. FS/*: df
A

reports file system disk usage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q
  1. FS/*: du
A

estimates file space usage

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q
  1. FS/*: sync; sync
A

synchronizes cached writes to persistent storage

sync;sync

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q
  1. FS/*: swapon
A

specifies devices on which paging and swapping are to take place.

swapon [options] [specialfile]

mount/unmount devices as swap files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q
  1. FS/*: swapoff
A

disables swapping on the specified devices and files. -a flag disables swapping on all known swap devices and files (form /proc/swaps, or /etc/fstab)

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

inode, table

A

each file has an inode containing metadata about the file. apps can retrieve the metadata using stat

inode table (df -i) contains all the inodes and is created when file system is created

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q
  1. FS/*: linux file types
A

Linux supports 7 different file types:

Regular file, various data; text, script, image, video, etc.
Directory file, name and address of other files
Link file, point or mirror other files
Character special file, represents device files, like hard drives annd monitors
Block special file, represents device files, like hard drives annd monitors
Socket file, provides inter-process communication
and Named pip file. allows processes to send data to other processes or recieve data from other processes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q
  1. Compression/*: tar
A

tar cfz bigfile.tgz bigfile compress
tar xf bigfile.tgz decompress

tar balls. generally used to pull files together for easy transport into another system or backup as a group. compression is a bonus feature by adding z to cfz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q
  1. Compression/*: dd
A

boot into rescue mode,
create mount point for external drive: mkdir /mnt/external
mount /dev/sdb1 /mnt/external
create compressed disk image: dd if=/dev/sda | gzip -9 > /mnt/external/filename.img.gz

copies data block by block

future recovery:
zcat /mnt/externak/filename.img.gz | dd if=/dev/sda

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q
  1. Compression/*: g{un}zip
A

replace original file with encrypted file
gzip bigfile
gunzip bigfile.gz

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q
  1. Compression/*: {un}zip
A

creates compressed file and leaves original intact.
zip ./bigfile.zip
unzip bigfile.zip

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q
  1. Compression/*: zcat
A

identical to gunzip -c; standard output, keepigng original file unchanged.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q
  1. Compression/*: zgrep
A

invokes grep on compressed or gzipped files.
zgreo [grep_options] [-e] pattern filename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q
  1. Compression/*: zless
A

filter for crt viewing of compressed text.

crt; certificate and private key files. public-key certificate following x. 509 standard, containind info in the server identy, name, geolocation and public key.

deep dives into the files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q
  1. Compression/*: zmore
A

file perusal filter for crt viewing of compressed text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q
  1. Data Streams: cat
A

cat [OPTION] [FILE]
concatenate files and print them on the standard output
cat bill.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q
  1. Data Streams: cmp
A

compares two files, byte by byte
cmp bill.txt bob.txt
differe on byte 171, line 1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q
  1. Data Streams: cut
A

remove selections from each line of files
cut -c 1-7 bill.txt // outputs first to 7th character,

1- //first character to end,
-40 up to 40th character

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q
  1. Data Streams: diff
A

compare files line by line

diff bob.txt bill.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q
  1. Data Streams: diff3
A

compare 3 files line by line

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q
  1. Data Streams: more
A

more [options] file

paging through the text, one screenful at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
64
Q
  1. Data Streams: less
A

opposite of more. paging through a text, all at once.

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

8.1. Data Streams: sort

A

sort lines of text files.

sort [OPTION]… [FILE]…

write sorted concatenation of all files to standard outpit

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

8.1. Data Streams: head

A

outputs the first part of files (1st 10 lines of each file)

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

8.1. Data Streams: tail

A

outputs the last part of files (last 10 lines)

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

8.1. Data Streams: tr

A

translate or delete characters.

works like substituting one patter for another

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

8.1. Data Streams: uniq

A

report or omit repeated lines
uniq [OPTION]… [INPUT [OUTPUT]]

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

8.1. Data Streams: wc

A

print newline, word and byte counts for each file

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

8.1. Data Streams: grep

A

print lines that match patterns
grep o bob.txt

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

8.2. Data Streams: find

A

search for files in a directory hierarchy

73
Q

8.2. Data Streams: hd

A

hexdump. displays file contents in hexadecimal, decimal octal or ascii.

74
Q

8.2. Data Streams: rev

A

rev bob.txt
‘reverse line characterwise’. outputs the file but reverses all the characters.

75
Q

8.2. Data Streams: locate

A

doesn’t search the entire file system like file. looks through regularly update file database (index) in the system, ergo faster.

sudo apt update
sudo apt install mlocate

locate bob.txt

75
Q

gcp

A

advanced command line copier

gcp [OPTIONS] FILE DEST

acts like cp (copy) but with high level functionality
(shows cp progress, skips problem files, logs which files copy succesfuly, remove incompatible chars like /. or * on VFAT),) and more

76
Q
  1. Shell: man
A

interface for displaying reference manuals

77
Q
  1. Shell: man -k
A

searches the short descriptions and manual page names for the given keyword as regular expresson. prints out matches. works like apropos

78
Q
  1. Shell: history
A

GNU history library keeps track of lines input by the user.
try history for giggles

79
Q
  1. Shell: <tab></tab>
A

CTRL+v+tab
tab autocompletes input

80
Q
  1. Shell: bash
A

GNU Bourne-Again SHell
sh-compatible language interpreter, executes commands read from an input .sh filew

81
Q
  1. Shell: env
A

runs a program in a modified environment
env [OPTIONS]… - [NAME=VALUE]… [COMMAND [ARG]…]

82
Q
  1. Shell: echo
A

echo xyz

displays a line of text

83
Q

9.1 Shell: alias/unalias

A

alias rt~=’rm -r *~’

unalias rt~=’rm -r *~’

84
Q

9.1 Shell: true/false

A

true does nothing, succesfuly.
false does nothing, unsuccessfuly.

85
Q

9.1 Shell: sleep

A

delays for a specified amount of time.

sleep 100 // sleep for 100 seconds

86
Q

9.1 Shell: which

A

locates a command (which file it belongs to)

87
Q

9.1 Shell: #!/bin/bash

A

“shabang”.

inscructs the program loader to use the /bin/sh program instead of any other, passing the oath of the script as the first argument.

88
Q

9.1 Shell: if [] then else fi

A

if [COMMAND]
then: RUN IF COMMAND IS TRUE
else: RUN IF COMMAND IS FALSE
fi: finish

89
Q

9.1 Shell: do while

A

while [COMMAND]
do: WHILE COMMAND IS TRUE
done: IF COMMAND IS FALSE.

90
Q

9.2 Shell: ulimit

A

get and set user limits. obsolite routine.

but in shell: displays or sets shell resource limits.
ulimit // reports the soft limit on file size.
ulimit -H // reports hard limit on file size.
ulimit -u 8000 // set soft limit on number of user processes to 8000

91
Q

9.2 Shell: /dev/tty

A

controlling terminal for the current process.
ps -a // to find out which ttys are attatched to which process.

92
Q

9.2 Shell: set

A

allows you to change the values of shell options and set the positional parameters, or display the names and values of shell variables.

https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html

93
Q

9.2 Shell: $?

A

ls duck
echo $?

$? is the return value of the last executed command. 0 if succesful, 2 if not. or anything other than 0, depending on the progra,.

last process’s exit status

94
Q

9.2 Shell: for i in [] do done

A

for VARIABLE In 1 2 3 4 5 .. N
do
command1
command2
command 3
done

for VARIABLE in file1 file2 file3
do
command1
command2
command3
done

for OUTPUT in $(cmd)
do
command1 on $OUTPUT
command2 on $OUTPUT
commandN
done

95
Q

9.2 Shell: apropos

A

searches the short descriptions and manual page names for the given keyword as regular expresson. prints out matches. works man -k.

search manual’s short descriptions

96
Q

9.2 Shell: * bind -p

A

bind command is for viewing and modifying readline keybindings.
-p will display both the keybindings and the corresponding function names.

97
Q
  1. Login & System: su
A

run command iwth substitute user and group ID

run

su [options] [-] [user [arguments…]]

98
Q
  1. Login & System: reboot
A

reboots the machine. returns 0 on success, non-zero failiure otherwise.

99
Q
  1. Login & System: shutdown
A

shutdown [OPTIONS] [TIME] [WALL…]
-H halts the machine
-P poweroffs
-r reboot

100
Q
  1. Login & System: users
A

print the user names of users currently logged in to the current host

101
Q
  1. Login & System: clear
A

clears the terminals screen

102
Q
  1. Login & System: hostname
A

show or set the system’sdisplays the system’s DNS name host name

103
Q
  1. Login & System: ifconfig
A

configure a network interface

with no additional commands, displays the status of the currently active interfaces.

104
Q

10.1 Login & System: exit

A

causes normal process termination

105
Q

10.1 Login & System: date

A

prints or sets the system date and time

106
Q

10.1 Login & System: w

A

show who is logged on and what they are doing

gives users, with more info (users)

107
Q

10.1 Login & System: whoami

A

prints effective userid

108
Q

10.1 Login & System: lshw

A

lists hardware. run with sudo, something might be missing.

109
Q

10.1 Login & System: last reboot

A

shows a listing of last logged in users

110
Q

10.1 Login & System: ssh -X/rsh/telnet

A

opens remote login client.
-X enables X11 forwarding. enable with caution: users bypassing remote host file permissions can perform attacks like keystroke monitoring.
use -x to disable x11 forwarding.

111
Q

10.2 Login & System: ~^Z

A

stops the current process and sends it to the background

112
Q

10.2 Login & System: * xterm

A

terminal emulator for the X window system.

113
Q

10.2 Login & System: * scp

A

openSSH secure file copy.

copies files between hosts on a network

114
Q

10.2 Login & System: * uptime

A

tells how long the system has been running

115
Q

10.2 Login & System: * xload

A

displays a constantly updating histogram of the system load average

116
Q

10.2 Login & System: * wall

A

writes a message to all users

117
Q

10.2 Login & System: * write

A

send a message to another user
write daniel tty

118
Q

10.2 Login & System: * netstat

A

prints network connections, routing tables, interface statistics, masquerade connections, and multicast memberships

119
Q

10.2 Login & System: * free

A

display amount of free and used memory in the system

120
Q
  1. Files: pwd
A

print name of current working directory

121
Q
  1. Files: ls
A

list directory contents

122
Q
  1. Files: lsof
A

list open files

123
Q
  1. Files: cp
A

copy files and directories

124
Q
  1. Files: mv
A

move (rename) files

125
Q
  1. Files: rm
A

remove files or directories

126
Q
  1. Files: mkdir
A

make directories

127
Q

11.1 Files: rmdir

A

remove empty directories

128
Q

11.1 Files: cd

A

change current directory

129
Q

11.1 Files: ln

A

make links between files.
lan [OPTIONS]… TARGET… DIRECTORY…
-P physical, creates a hard link.

(hard link is its own file, soft link just points to the name of the original file)

130
Q

11.1 Files: touch

A

creates the file if it doesn’t exist,
updates the access and mod times of each FILE to the current time,
-c flag will not create any file,

131
Q

11.1 Files: ftp

A

ftp host [port]
functions like open host [port]

132
Q

11.1 Files: ~

A

shortcut for user’s home directory

133
Q

11.1 Files: .

A

current directory

134
Q

11.2 Files: ..

A

directory immediately above the current one

135
Q

11.2 Files: .bashrc

A

script file that’s executed when a user logs in

136
Q

11.2 Files: .profile

A

present in your $HOME directory, overrides /etc/profile file to customize individual working environment.

137
Q

11.2 Files: pushd

A

pushd [OPTIONS] [DIRECTORY]
pushd /home // push the current directory to the top of the directory stack and change to /home

popd will pop the top directory from the stack and move ‘down’ the stack.

138
Q

11.2 Files: popd

A

pushd [OPTIONS] [DIRECTORY]
pushd /home // push the current directory to the top of the directory stack and change to /home

popd will pop the top directory from the stack and move ‘down’ the stack.

139
Q

11.2 Files: source

A

reads and executes the file content in the current shell.

(can type set of commands into a text.txt and use source to run all the commands)

source cmdlist.txt

140
Q

11.2 Files: * readlink

A

print resolved symbolic links or canonical file names, path links and buffer

141
Q

11.2 Files: * tree

A

list contents of directories in a tree-like format

142
Q
  1. I/O Redirection: stdin
A

extern FILE *stdin;
standard input

143
Q
  1. I/O Redirection: stdout
A

extern FILE *stdout;
standard output

1

144
Q
  1. I/O Redirection: sterr
A

extern FILE *stderr;
standard error

2

145
Q
  1. I/O Redirection: <
A

read the command’s input from a file instead of from the keyboard

sort < data.txt

overwrite stdin

146
Q
  1. I/O Redirection: >
A

sends input (from terminal?)to output file
cat bill.txt > bob.txt

overwrite stdout

147
Q
  1. I/O Redirection: 2>
A

2 denotes standard error,
> output,

therefore 2> outputs the standard error

overwrite stderr

148
Q
  1. I/O Redirection: &>
A

redirect standard output

write over stdout AND stderr

149
Q
  1. I/O Redirection: «
A

append stdin

150
Q
  1. I/O Redirection:&raquo_space;
A

append stdout

151
Q
  1. I/O Redirection: 2>&1
A

stdout and stderr

152
Q
  1. I/O Redirection: /dev/null
A

vacuuuuuuum go vuuuuum

153
Q
  1. I/O Redirection: tee
A

named after and functions like a T-pipe.
wc -l text1.txt|tee -a text2.txt

outputs the bit count of text1.txt to console, but also appends it to text2.txt (-a flag appends. removing the -a flag will overwrite the contents of text2.txt)

154
Q
  1. I/O Redirection: script
A

makes typescript of terminal session.
script [options] [file]

155
Q
  1. I/O Redirection: cmd - command substitution
A

allows the output of a command to replace the command itself.

$(command)
command

for example: $(cat file)

whatever was written in that file becomes the command

156
Q
  1. I/O Redirection: ^D
A

logs you out of any terminal and closes it, or gets to back to the original user before using su or sudo.

157
Q
  1. Compilation/*: {g}cc/g++
A

g++: GNU C and C++ compiler. compiles .c and .cpp files.
gcc: GNU C compiler. compiles .c files

g++ is an alias for including c++ files

158
Q
  1. Compilation/*: gcc/g++ -g
A

g++: GNU C and C++ compiler. compiles .c and .cpp files.
gcc: GNU C compiler. compiles .c files

-g flag generates debug info to be used by GDB debugger.
tells gcc to generate source-level debugging/symbol info within the executeable itself. IF the program crashes and produces a core file, is killed, or a program calls a function that dumps its core

159
Q
  1. Compilation/*: ld
A

GNU linker.

ld [OPTION] objfile.

combines object/archive files, relocates their data and ties up symbol differences

last step in compiling a program is to run ld, usually

converts multiple linked files into a single .a/out

160
Q
  1. Compilation/*: nm
A

list symbols from object files

161
Q
  1. Compilation/*: ar
A

create, modify and extract from archives.

archive: single file holding collection of other files ina structure that that makes it possible to find/retrieve the original files/’members’

runes compiler and finds the issues

162
Q
  1. Compilation/*: gdb
A

GNU debugger.

interface for seeing what happens ‘inside’ a program as it executes, or what another program was doing as it crashed.

163
Q
  1. Compilation/*: make
A

GNU make [OPTION]… [TARGET]
GNU make utility to maintain groups of programs

auto-detects what pieces of a large program need to be recompiled, and issues commands to recompile them.

164
Q
  1. Compilation/*: valgrind
A

tool for debugging, finding memory leaks, detection and profiling

165
Q
  1. Compilation/*: splint
A

Secure Program Lint
programming tool for statically checking C programs for security vulnerabilities and coding mistakes.

automatically finds and points out vulnerabilities and mistakes in C programs

166
Q
  1. Compilation/*: core file
A

generated when a program terminates unexpectedly, helps determine what caused the termination.

167
Q
  1. Compilation/*: gprof
A

display call graph profile data

168
Q
  1. Permissions: chmod
A

change file mode bits

changes file moded bits of each given file,

169
Q
  1. Permissions: chown
A

change file owner and group
chown [OPTION] [OWNER] FILE
chown [OPTION] [OWNER][:[GROUP]] FILE

170
Q
  1. Permissions: chgrp
A

change group ownership
chgrp [OPTION]… GROUP FILE

171
Q
  1. Permissions: mask
A

manipulate nmh message sequences

change spe

172
Q
  1. Permissions: unmask
A

user file creation mode mask

set file mode creation mask

set default

173
Q
  1. Permissions: setuid
A

set user identity

174
Q
  1. Information tools: espdiff
A

apply the appropriate transformation to a set of patches

175
Q
  1. Information tools: fortune
A

displays a fortune

176
Q

cosway

A

cow goes moo

177
Q
  1. User Montor: xeyes
A

googly eyes