Commands - Review Flashcards

(275 cards)

1
Q

Search which subdirectories are in a directory that match a word.
Linux

A

ls -la /locationtosearch | grep wordtomatch

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

Find files with a specific word.
Linux

A

grep -rw /home/user/Downloads -e “vacation”

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

How do you search for a word in multiple files

L

A

grep study *_notes.txt

grep fruit *.txt (search for fruit in a group of text files)

grep fruit apple.txt banana.txt orange.txt

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

How do you search for a word in a file. L

A

grep oranges fruit.txt

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

To create a new file with default permissions L

A

touch test_file.txt

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

How do you create/modify a text file using the popular text editor that can be found on nearly all Linux distributions?

A

nano my_file

Can create and modify a text file in the command line

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

To make a text file in Linux with a redirector

A

cat > (name of file)

ENTER key, then type text, then save file with CTRL + D

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

Find files with a specific word L

A

grep -rw /home/user/Downloads -e “vacation”

**having issues with this one, it won’t find my “file” files in a subdirectory

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

What’s the main way I should use to search for which subdirectories or files match a word? L

A

ls -la /locationtosearch | grep wordtomatch

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

L: options available for a command

A

(command) –help

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

extra information about commands - manual pages

Linux

A

man (command)

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

long list format (something is too long, make it readable and organized with this command, more detail)

Linux

A

-l

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

show all files in a directory and hidden files flag
Linux

A

-a

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

hide a file or directory

Linux

A

.(in front of file or directory)

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

current directory

A

pwd

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

change directory 3 ways

A

cd
cd ..
cd ~

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

make a new directory

A

mkdir

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

copy a file/directory 3 ways

A

cp filename.ext location
pattern copies: cp *.png ~/Desktop
directory copies (inside contents): cp -r ‘Cat Pictures’ ~/Desktop

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

moving a file

A

mv filename.txt locationtomoveto

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

to make a text file with a redirector and enter text right away

A

cat > (name of file)

ENTER, type text, save with CTRL +D

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

view text files 2 ways

l/w

A

cat

less
-g
-G
-/word_search
-q

more (windows)

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

flags/parameters that can be used with cat when to view certain lines? 2

A

-Head Line#
-Tail Line#

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

modifying text file (create a new one with nano) and enter text right away

A

nano my_file

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

how do you search for a word in one file?

linux

A

grep word filename.ext

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
how do you search for a word in multiple files? 3 ways linux
grep word *_filename.extension grep word *.extension grep word filename filename filename
26
How do you filter the standard error output into a linux black hole? shows just the output, no errors
/dev/null less /var/log/syslog 2> /dev/null
27
search which subdirectories are in a directory that match a word
la -la /directorytosearch | grep wordtomatch
28
command line and shortcut to copy/move files to current directory
mv (path to file to move) .
29
find files with a specific word linux
grep -rw /home/user/Downloads -e "vacation"
30
create a new file with default permissions no typing text linux
touch filename.txt
31
how to open a file with nano (or creates a new one)
nano path/to/existing/file or nano filename.txt
32
run a command that requires root privilege
sudo (command) file/path sudo su - then re-do command after getting root powers
33
view memberships for all groups - who can access run sudo
cat /etc/group (4 fields separated by colons)
34
view user information on our local machine linux
/etc/password
35
two ways to search for a word in a file (and filename) in a specific directory linux
grep -rw /file/location -e "word" ls /file/location | grep word -r
36
how to get detailed listing directories? w
Get-Help ls Get-Help ls -Full
37
how to show hidden files in a directory? w
ls -Force (directory or drive name)
38
how to show what directory you're in?
pwd
39
how to change your directory up one level and up one level to a specific directory?
up one level: cd .. a specific directory: cd ../directoryabove on linux cd ..\directoryabove on windows
40
What's a shortcut to change to the home folder in windows?
cd ~
41
What's a shortcut to change to the Desktop? both
~/Desktop ~\Desktop
42
What does the tilde ~ mean? What about ~\?
tilde ~ means the user's home directory ~/ means a directory path below the home directory ~\
43
What are the escaped commands for windows and linux that replace special character such as spaces and brackets?
windows: ` back tick spaces: single quotes, underscores Linux: \ backslash
44
see a list of previously entered commands how to search through results shortcut?
history ctrl + r to search through previous commands
45
whats an alternative to older powershells to search through previous commands lists in history?
#+tab to cycle
46
to copy a file
cp file filedestination
47
how do you copy multiple files? both
use a wildcard asterisk to select multiple files that match a pattern cp *.jpg copydestinationpath
48
how do you copy a directory? windows
cp 'directoryname' targetdestination -Recurse -Verbose
49
how to rename a file?
mv .\filename newfilename the .\ tells it that you don't want to move the file in the current directory, just rename it
50
How to move a file?
mv filename filelocation
51
How to move multiple files?
wildcard * to select multiple mv *filename targetlocation ex: mv *_document.txt ~\Documents
52
How do you remove a file
rm or remove
53
How do you remove a system file and bypass warning?
add the -Force flag at the end rm importantfilelocation -Force
54
How do you remove a folder?
use -recursive rm ~\foldername -recursive
55
removing a file, folder... whats a shortcut to the file path instead of the absolute?
rm ~\filename add -recursive flag if removing a folder
56
how to view contents of a file? 2 linux and windows
cat filename auto changes to cat .\filename windows: more largedocument linux: less largedocument
57
on windows using cat, what 2 parameters can we use to see only first and last few lines of text?
-Head #oflines -Tail #oflines
58
How to view large output text files on Windows in pages and how do you navigate?
more largedocument ENTER advance by line SPACE advance by page Q exit
59
how to open a text editor program and create a file windows
start texteditor filename example: start Notepad++ filename
60
how do you see what the actual powershell command of a command is?
Get-Alias
61
what's the cmd.exe version of Get-Help?
\?
62
how do you search for words in a file, a type of file, or a directory on the entire computer? windows
sls or Select-String Select-String word filename.txt Select-String word *.txt
63
how do you search for a pattern within a specific directory? windows
ls 'directorypath' -Recurse -Filter *pattern ls 'D:\Program Files\' -Recurse -Filter *.exe
64
how do you change standard output to display in a new or existing file by overwriting? windows
echo outputcontentforfile > filename.txt
65
How to change the standard output to add onto an existing file, no overwriting? windows
>>-Append echo outputcontentforfile >> existingfilename.txt
66
How to send the output of one command into the input of another? windows
cat filetosearch | Select-String wordtosearchfilefor takes output of cat, inputs it to sls to search for the word | pipe
67
How do you search for a word in one file? windows
cat filetosearch | Select-String wordtosearchinfile
68
how to use pipe operator to save standard output of a word search of a file to a new file or overwrite one? windows
cat filetosearch | Select-String wordtosearchfor > filename
69
How to redirect standard error stream to a text file?
2> rm secure_file.txt 2> filenameforerror.txt
70
How to filter out standard error stream messages? Windows (redirect error stream to a black hole)
$null example: rm securefile.txt 2> $null
71
How do you get input from a file and not the keyboard?
< less than example: cat < fileinput.txt same as cat fileinput.txt
72
how do you see a list of users and groups on the computer? Windows
1. Get-LocalUser 2. Get-LocalGroup 3. Get-LocalGroupMember
73
What's the alias for cat?
Get-Content
74
How do you change your password on Linux?
passwd
75
How to make the user change their password on next logon linux
sudo passwd -e username
76
To remove a user on Linux?
sudo userdel username
77
To add a user on Linux?
sudo useradd username
78
How do you remove a user on Windows? 2 ways
net user username /del Remove-LocalUser username
79
How to create an acct that requires logon password change in same command line windows?
net user username pa5sw0rd /add /logonpasswordchg:yes
80
How do you add a new user? windows
net user username * /add net user username 'some_password' BUT THIS IS NOT SECURE do not use this
81
How do you require a next logon password change? windows
net user username /logonpasswordchg:yes
82
How do you view file permissions in Linux?
ls -l ~/my_file for me it worked like this: ls -l dog.txt
83
How do you see ACL assigned to a file/permissions? Windows
icacls filefolderpath icacls /? for help
84
How do you modify a file/folder permission in the CLI? Windows
icacls ‘C:\Vacation Pictures\’ /grant ‘Everyone:(OI)(CI)(R)’
85
How do you only let non-guest users see a file or folder? w
icacls 'filepath' /grant 'Authenticated Users: (OI)(CI)(R)'
86
How do you remove file permissions for a group? w
icacls 'filepath' /remove Everyone
87
How do you change permissions in Linux?
1. Pick which permission you want to change (owner is u, group is g, other users is o ) 2. Add/remove permissions with + or - to indicate who it affects chmod u+x filename (this example we want to give executable access to the owner)
88
How do you remove a permission to a file?
chmod u-x filename
89
How do you add multiple permissions to a file? Read and Exec Linux
chmod u+rx filename
90
How do you set numerical permissions for 3 permission sets for a file in Linux?
chmod 746 filename combination of adding up permissions: r,w,x = 4,2,1
91
How do you change the owner of a file? Linux
sudo chown username filename
92
How do you change the group a file belongs to? Linux
sudo chgrp groupname filename
93
To view special permissions for a file in the CLI w
icacls filelocation
94
How do we enable files to be run by the permissions of the owner of the file (for other users to access without root priv?) Linux
Do a setuid special permission sudo chmode 4441 filename sudo chmode u+s filename (the first 4 is the setuid)
95
How do you see user/group permissions for when you would run the passwd command?
ls -l /usr/bin/passwd
96
What are two ways to implement the setgid Linux permission for a file?
1. sudo chmod g+s filename 2. sudo chmod 2551 filename (2 is the setgid)
97
How would you look at the permissions for the temp directory, and how to make it display just the directory not the contents? Linux
ls -ld /tmp
98
How to list permissions for a folder but only show directory info, not contents Linux
ls -ld /tmp
99
What are the symbolic and numerical versions of the special permissions for a sticky bit?
Symbolic - t Numeric - 1
100
How do you create a file not a folder in PowerShell? 2 ways
start Notepad++ filename.txt Notepad filename.txt
101
How do you force PS to bypass warning and delete the directory?
rm filename -Force
102
What's the position of Get-Alias in a command line?
Get-Alias commandname
103
What command do you use to search for a pattern in a specific directory?
ls example: ls 'filename' -Recurse -Filter *patterntosearch
104
How do you modify the ACL in PS to allow read access to a single user?
icacls filename /grant 'Username:(R)'
105
What's the difference between chmod and chown?
chmod is for modifying permissions chown is for modifying owner
106
What is the name of the privileged file on Linux that stores scrambled passwords?
/etc/shadow
107
Name 3 ways an Admin can remove users on PS
1. net user username /del 2. Remove-LocalUser username 3. GUI > Local Users and Groups in Computer Management > Right click user > Del
108
In Windows, when setting basic permissio n "Read" which special permissions are enabled? 3
1. Read data 2. Read Permissions 3. Read attributes
109
What's the easiest way to make a document public/accessible to everyone?
Add the desired permission (read) to the "Everyone" group icacls filename /grant "Everyone:(r)"
110
How to add a file permission to a specific user windows?
icacls filename /grant “username:(r)(w)(x)”
111
How to remove a file permission for a specific user Windows?
icacls filename /remove “username”
112
How to grant everyone (owner, group, other users) all permissions using symbolic format and numerical?
sudo chmod a+rwx filename or sudo chmod 777 filename
113
To install an executable file from PS?
type in the absolute path OR change directory to file and type in filename
114
What are the 7 commands for self-extracting executables?
1. /extract:[path] extracts the content of package to the path folder. If no path provided, Browse box appears 2. /log:[path to log file] enables verbose logging (more detailed info recorded in log file) for the update installation 3. /lang:lcid sets user interface to specified locale when multiple locales are in the package 4. /quiet runs package in silent mode 5. /passive runs update without any interaction from user 6. /norestart prevents prompting user when a restart is needed 7. /forcerestart forces a restart of the computer as soon as the update is finished
115
What's the command to install a debian package on Ubuntu?
sudo dpkg -i filepath -i for install
116
How to remove a program from Ubuntu?
sudo dpkg -r programname
117
How to list debian packaged installed on machine
dpkg -l - -l for list
118
Search for a program you installed ubuntu
dpkg -l | grep atom or dpkg -s packagename
119
Force an update of the package manager (for a program)
after using dpkg -s programname if its out of date: sudo apt-get install -f
120
Update program repositories
sudo apt-get update
121
Install a program from the Linux repository
sudo apt-get install program/packagename
122
To remove a program Linux
sudo apt-get remove programname
123
Command to extract and compress files Windows
Compress-Archive -Path C:\Users\cindy\Desktop\CoolFiles\ ~\Desktop\CoolArchive.zip
124
Extract file using 7 Zip Linux
7z e filepath - she said to use e as a flag but there’s no -e for this command
125
To compress all files in directory Linux
7z a test *
126
Windows command to extract a zip file?
Expand-Archive filename
127
How to create an archive with 7zip Linux
7z a folder.7z filename.txt filename.awk
128
How to create an archive with Zip Linux. How do you do it with a file and then a folder?
zip NewfolderName.zip fileName.txt fileName.txt zip -r folderName.zip fileName.txt folderName this can overwrite a current zip file and also can use -r to include files in a directory
129
How to see what's inside a Zip file? Linux
zipinfo filename.zip
130
How to create an uncompressed tar archive?
tar -cvf filename.tar filetoadd/
131
How to create a tar archive AND compress it?
tar -cvzf filename.tar fileNametocompress/ -the -z uses the Gzip default zip tool on Linux tar -xvIf archiveName.tar fileNametocompress/ -the -I uses bz2
132
How to extract files using Gzip or Bz2?
tar -xvzf archiveName.tar.gz tar -xvIf archiveName.tar.bz2 - he also used `gunzip`for gzip
133
How to view group information on Bash?
cat /etc/group
134
create an archive file called file.tar from the three files named file1, file2 and file3
tar -cf file.tar file1 file2 file3
135
With what options are tar files created?
-c and -f
136
How to create an uncompressed tar file?
tar -cf file.tar file1 file2 file3
137
List files included in the archive when creating tar file
tar -cvf file.tar file1 file2 file3 (the -v verbose command)
138
How to create tar files from 1+ directories
tar -cvf dir.tar dir1 dir2
139
How to create a tar file of every object in current directory (*wildcard)
tar -cf *
140
How to remove files being tar archived instead of being copied
add --remove-files
141
Compress a new tar file upon creation 3 ways
-j for bzip2 -z for gzip -Z for compress example tar -cvjf files.tar.bz2 file4 file5 file6
142
How to unpack a tar file (different from decompress)
tar -xvf file.tar
143
How to decompress a tar file (bzip2 for this example)
tar -xjvf files.tar.bz2 (needs both extract command and the program to decompress it's command)
144
How to add files to an existing tar archive
tar -rf file.tar file7 -r and -f are necessary (f to indicate the following string is the name of the archive)
145
Delete specified files from a tar file
tar -f file.tar --delete file1 file2
146
How to list contents of an uncompressed tar archive
tar -tf file.tar
147
List options available for tar command
- - help
148
How to locate software and its dependencies on Windows?
find-package -Name Find-Package -Name packagename -IncludeDependencies
149
How to add a package source? W
Register-PackageSource Register-PackageSource -Name chocolatey -ProviderName chocolatey -Location http://chocolatey.org/api/v2
150
How to verify package source? W
Get-PackageSource
151
Install a package Windows
Install-Package -Name packagename
152
Alternate: Install a package Linux
sudo dpkg - -install packagename
153
Update package saved locally Linux
sudo dpkg - -update-avail packagename
154
to remove a package Linux
sudo dpkg - -remove packagename
155
to purge a package and contents linux
sudo dpkg - -purge packagename
156
to get a list of packages installed linux
sudo dpkg - -list
157
get a list of all files belonging/associated with a package linux
sudo dpkg - -listfiles packagename
158
Windows: Uninstall a package
Uninstall-Package -Name packagename
159
How to install a package with apt? Linux (apt is for Ubuntu)
sudo apt install packagename
160
Remove a package with apt
sudo apt remove packagename
161
How to update list of packages in your repository? L
apt update
162
How to install/upgrade packages in your repository? L
Use apt update first then use apt upgrade
163
How to learn more about commands with apt?
apt - -help
164
How to install millsoftware package from the chocolatey software source? Windows
Install-Package -Name millsoftware -Source chocolatey
165
How to list more detailed contents of uncompressed tar archive?
tar -tvf file.tar the -v gives us more information than just "filename"
166
On Windows, how do you verify that a package was installed?
Get-Package -Name packagename
167
How do you check what kernel version you have? L
uname -r
168
How to check system information? L
uname
169
How to update kernel and other packages? L
sudo apt full-upgrade (run sudo apt update first)
170
What are 2 ways to update the Ubuntu distribution?
1. Update Manager GUI - checks automatically 2. apt - check for updates manually apt-get update apt-get upgrade
171
How would you install "awesomesoftware" from the chocolatey software source? PowerShell
Install-Package -Name awesomesoftware -Source chocolatey
172
Linux: Before installing software, always run this command to get an updated version of software
sudo apt update
173
How do you install a software package named "boo" on Ubuntu?
apt-get install boo
174
How do you verify that a software package was installed on PS?
Get-Package -Name TestPackage
175
Which command will show you what Linux kernel version you have?
uname -r
176
PS: How do you install a package called "TestPackage"?
Install-Package -Name TestPackage
177
What command will update your Linux application sources?
sudo apt update
178
How do you install a new version of the Linux Kernel?
sudo apt full-upgrade
179
What command will update your Linux application sources?
sudo apt update
180
What are the 8 steps to partition/reformat a disk on Windows?
1. Diskpart 2. list disk 3. select disk 1 4. clean 5. create partition primary 6. select partition 1 7. active 8. format FS=NTFS label=my-usb-drive
181
What command do you use to partition a disk on Linux?
parted
182
How do you see what disks are connected to a computer using Linux?
sudo parted -l (el)
183
How do you select the /dev/sdb USB drive to start the partition?
sudo parted /dev/sdb enters interactive mode
184
How do you get out of interactive mode in parted?
quit
185
How do you set a disc label while partitioning on Linux?
mklabel (partition table name)
186
In Interactive Mode, how do you see disk information on Linux?
print
187
What are the 8 steps to partition and format a FS on Linux? (Not mounted yet)
(sudo parted -l to see disks available) 1. sudo parted /dev/sda 2. print 3. mklabel (partition table we want) 4. print 5. mkpart primary ext4 1MiB 5GiB (partition disk in 2) 6. quit 7. sudo mkfs -t ext4 /dev/sda1 to format partition with FS 8. sudo parted -l
188
In Linux, how do we select the partition table we want in interactive mode?
mklabel (partition table)
189
In Linux, how do we partition a disk that's already been assigned a partition table in interactive mode?
mkpart (partitiontype) (FS) (Start) (End)
190
In Linux, how do we format a filesystem on a disk that's already been partitioned?
Out of interactive mode: sudo mkfs -t (FS type) /dev/sda1
191
How do you unmount a filesystem in Linux?
sudo umount (directory name) or sudo umount /dev/(name)
192
What command shows us the UUID of block devices on Linux?
sudo blkid
193
What are 2 ways to update the Ubuntu distribution via CLI?
sudo apt-get update sudo apt-get upgrade
194
The apt command is for which Linux distribution?
Ubuntu
195
What command is used to mount/unmount file systems in Linux? Manually and Automatically
Unmount Manually: sudo umount directory sudo umount /dev/sdb1 Mount/Unmount automatically: fstab
196
What does fstab mean? Linux
File system table
197
Command to check fstab manual page for the file system in use? Linux
man fstab
198
When combined with fdisk, what command do you use to find the list of block devices connected to the system? Linux
lsblk
199
How do you make a swap space/swap partition? Linux 7 steps
How to make swap space/swap partition (manual) 1. select target device with sudo parted /dev/sdb 2. print 3. mkpart primary linux-swap 5GiB 100% 4. print 5. quit 6. specify it's a swap space with sudo mkswap /dev/sdb2 7. enable swap on device with sudo swapon /dev/sdb2 - auto mount swap space will need an entry in the fs table
200
How do you create a symbolic link for file_1.txt? What program do you use? W
use mklink and add symlink mklink file_1_symlink file_1.txt use command prompt cmd.exe
201
How do you make a hard link for file_1.txt? What program do you use? W
use mklink /H mklink /H file_1_hardlink file_1.txt command prompt cmd.exe
202
How do you create a soft link/sim link on Linux?
ln -s important_file important_file_softlink - -s for soft link
203
How do you create a hard link on Linux?
ln important_file important_file_hardlink - no -s this time - ls -l filename to check hard link count
204
What command on Windows allows us to print out disk usage, how many files it has?
disk usage can also go to disk management make sure to download the DU tool
205
How to run disk cleanup from command line? W
c:\windows\SYSTEM32\cleanmgr.exe /dDrive  Drive = enter drive here
206
How to view disk usage on Linux?
du -h - if no directory is specified, it defaults to the current one - -h means in human-readable form
207
How to view free disk space with command on Linux?
df -h shows you the free space available in your entire machine
208
How to check the status of NTFS self-healing feature?
command prompt fsutil repair query C:
209
How to run the check disk utility tool (serious disk corruption)
chkdsk /F D: in the command prompt - by default runs in read-only mode, no changes made - can tell it to fix any problems it finds with /F flag
210
On Linux, what command to repair a file system?
make sure the file system isn’t mounted (it’ll damage the file system) sudo fsck /dev/sda
211
An important command-line data recovery tool offered in the Linux operating system
fsck for data corruption repair USE CAUTION look at notes
212
What command displays disk volume, and can be paired with other tools for disk repair?
chkdsk
213
How to display an output in human-readable format? Linux
-h flag
214
What are two ways to see disks mounted on a system? Linux commands
1. df -h - disk free, usually used to see how much free space in the file system. -h for human readable format. 2. lsblk - lists block devices
215
Two ways to display partition information on Linux?
You can display partition information using the fdisk command. OR You can also use the -l option to list partitions in the block. You can pass a device name to the fdisk command to list the partitions contained in that device. To list all partitions, use fdisk -l
216
With what command do you stop a process in Windows?
taskkill /pid #### we use the process ID to specify which process
217
What command enables you to get the PID of a process? Windows
tasklist
218
What's the shortcut to open the task manager? Windows
CTRL-SHIFT-ESC
219
2 ways to show all running processes in Windows through commands?
1. tasklist 2. Get-Process
220
How to view running processes on Linux? 2 ways Explain what the flags mean
1. ps -x 2. ps -ef -x gives you a snapshot of all the processes running -e gives you all processes, including ones started by other users -f gives you the full details about a process
221
What command do you use to view files that correspond to processes on Linux? How do you get more detailed information about the status of a process? 2 answers
ls -l /proc More info: cat /proc/PIDnumber/status
222
What command do you use to search through the process output for a particular process? Linux
ps -ef | grep Firefox
223
How do you send a signal to a running process? Windows + Linux
CTRL + C
224
How do you terminate a running process in Linux? 2 ways
1. kill PID# kill command without any flags sends a termination signal SIGTERM. Kills process but gives it time to clean up resources it was using (prevents file corruption) 2. kill -KILL PID# kill command with -KILL SIGKILL signal will overkill terminate process (doesn’t let it clean up resources it was using)
225
How do you pause/suspend a process in Linux? 3 ways
1. kill -TSTP PID# 2. CTRL + Z 3. CTRL + C
226
With what command do you resume the execution of a process? Linux
kill -CONT PID#
227
How do you display the top 3 processes using the most CPU? Windows command
Get-Process | Sort CPU -descending | Select -first 3 -Property ID,ProcessName,CPU
228
What command for Linux lets us see the top processes that are using the most resources?
top
229
What's another resource monitoring tool for Linux that shows us the load average of the machine?
uptime
230
With what command do you list open files and what processes are using them in Linux?
lsof
231
How would you search for a process with a partial match, and a specific match? Windows
Specific Match: Get-Process -Name "pname" Partial Match: Get-Process -Name "*pname*"
232
How do you terminate a specific process in Linux?
ps -aux | grep "processname"
233
How do you start PuTTY from PowerShell?
putty.exe -ssh vanes@ipaddress port# you input the ip address and user name you want to connect to
234
You're in vanes\Documents, you want to get to the Desktop which is up one level. What command can you use instead of cd.. then cd Desktop? Windows
cd ..\Desktop
235
When copying over a directory in Windows with a command, what parameter should you use to make sure you copy the contents as well?
-Recurse parameter used with cp copies contents of the directory over
236
What's a shortcut to change directories to another directory in the current directory? Windows
cd .\nameofthedirectoryinthesamedirectory
237
What's the recursive flag for Linux?
-r example cp -r 'filename' filelocation
238
What's a shortcut when renaming a file to keep it in the same directory? Windows
mv .\bluefile.txt yellowfile.txt (blue being renamed to yellow but staying in the same directory and also indicating that the file name we want to change is in the same directory)
239
How do you move multiple files?
using the asterisk wildcard character
240
When copying a file or directory what needs to go around the filename?
single quotes (when copying a directory)
241
On Windows, how do you remove a file and bypass not having permission to remove it?
-Force parameter rm C:\Users\vanes\important_system_file -Force
242
On Windows, how do you remove an entire directory?
rm ~\foldername -recursive or can use
243
What flag/parameter for Windows and Linux do you use to see a text output of the actions being taken?
-v for Linux -Verbose for Windows
244
What's the Linux equivalent of the more command on Windows?
less q to exit g to go to the beginning G to go to the end /word_search
245
How do you open a program and create a file in one command line? Windows
start programname filename.ext
246
How would you open notepad and Notepad ++ and create a new file in the same line? Windows
start Notepad++ textfile.txt notepad filename
247
With what command and flag would you be able to see file ownership and permissions on Linux?
ls -l (ls el)
248
What is the command you use in Linux to copy files between computers on a network? What's an example of this command in use?
scp (filename want to transfer) (useracc/hostname want to send to)@IPaddress: scp /home/cindy/Desktop/myfile.txt cindy@104.131.122.215:
249
What's an example command of using PuTTY's secure copy client to transfer the desktop file my_file.txt to cindy's Linux workstation from Windows?
pscp.exe ~\Desktop\my_file.txt cindy@101.43.11.892:
250
What command lets you share folders on Windows?
net share
251
Show an example of using the folder share command on Windows to share a folder called ShareMe with everyone, giving them full permissions
net share ShareMe=C:\Users\cindy\Desktop\ShareMe /grant:everyone,full
252
Besides transferring files, what else does the net share command show us? Windows
Shows us what folders are currently being shared on your computer
253
What's the Linux command to copy files from a storage device? (imaging a machine)
dd sudo dd if=/dev/sdd of=~/Desktop/my_usb_image.img bs=100M This just says that she’s going to copy the contents of /dev/sdd (the USB drive) and save it to the desktop in an image file
254
How do you run Error Checking (check disk) from the command line on Windows?
chkdsk /f /f means to fix any issues that come up
255
How do you format a drive from the command line on Windows?
format drive [/v:label] format p: /fs:exfat /v:my_thumb_drive
256
How do you record a group of commands as they're being issued along with the output on Windows from the command line? [Documents your steps and process in order to revert any changes and when you're not sure how exactly you'll be fixing an issue]
Start-Transcript
257
What's the command to install an SSH client on a machine you're connecting from? (for remote connection on Linux)
sudo apt-get install openssh-client
258
What's the command to install an SSH server on the machine you're connecting to to establish a remote connection on Linux?
sudo apt-get install openssh-server
259
In Linux, how do you ping a website to check your internet connection?
ping www.google.com
260
How do you access a local host file on Linux?
sudo /etc/hosts
261
In Linux, how do you get the name server of a host or domain name?
nslookup www.google.com
262
How do you check if a daemon is running on the machine? Linux
service ntp status ntp = network time protocol for this example
263
How do you stop, start, and restart a daemon/service in Linux?
sudo service ntp stop sudo service ntp start sudo service ntp restart ntp = network time protocol
264
Windows: How do you get the status of a running service?
Get-Service wuauserv windows update service in this example
265
Windows: To get more information on a service (type, configuration)
Get-Service wuauserv | Format-List * windows update service in this example
266
Windows: How to stop a service (admin)
Stop-Service wuauserv windows update service in this example
267
Windows: How to start a service (admin)
Start-Service wuauserv windows update service in this example
268
Windows: How to list all services that are registered in the system (admin)
Get-Service windows update service in this example
269
How do you install a service on Linux?
sudo apt install servicename
270
How to query the status of a service in Linux?
service servicename status
271
How do you connect to an ftp server with the lftp client on Linux?
lftp localhost
272
How do you edit the configuration file for a service in Linux?
sudo vim /etc/vsftpd.config the service is vsftpd (a simple FTP server)
273
How do you join a computer to AD via PowerShell?
Add-Computer -DomainName ‘example.com’ -Server ‘dcl’
274
How do you get the AD version of DA via PowerShell?
Get-AdForest then Get-AdDomain
275
How do you open GPMC via CLI on Windows? (Group Policy Management)
gpmc.msc