unix

0.0(0)
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Get a hint
Hint

Within a directory, what must each name be?

Get a hint
Hint

Within a directory, each name (file or directory) must be unique (UNIX is case sensitive tho)

Get a hint
Hint

UNIX root node

Get a hint
Hint

/

Card Sorting

1/42

Anonymous user
Anonymous user
encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

43 Terms

1
New cards

Within a directory, what must each name be?

Within a directory, each name (file or directory) must be unique (UNIX is case sensitive tho)

2
New cards

UNIX root node

/

3
New cards

what does . refer to in any directory?

itself

4
New cards

what does . . refer to in any directory?

the parent directory

5
New cards

pwd

present working directory, returns what directory you are in

6
New cards

cd

change directory. with no arg, goes to home directory, else, goes to arg

7
New cards

mkdir

make new directory (mkdir newdirectory)

8
New cards

mv

move (renames file or directory) (mv oldname newname) (also move files (mv filename directoryname))

9
New cards

ls (ls -l) (ls -a)

lists contents of directory (lists w detail) (lists even hidden ones)

10
New cards

date

prints current date and time

11
New cards

touch

Reset the modification date and time of a file to now (if file does not exist, creates new one) (touch filename)

12
New cards

cp, cp -r

Copy a file: cp filename copyoffile. copy a directory: cp -r dirname copydir

13
New cards

rm

Remove. Delete a file: rm filename

14
New cards

rmdir

Remove empty directory. Delete a directory (which needs to be empty): rmdir dirname

15
New cards

cat

Concatenate. Print out the contents of a file: cat filename

16
New cards

head

Print out the first lines of a file: head filename

17
New cards

tail

Print out the last lines of a file: tail filename

18
New cards

more

Print out the contents of file one screen at a time: more filename

19
New cards

less

Print out the contents of file one screen at a time: less filename. Like more, but allows backward movement.

20
New cards

man

Manual. Displays the online manual page for the given argument

21
New cards

cd ~, cd .., cd -

home directory, parent directory, last directory you were in

22
New cards

cp -r

cp -r directoryname copyname (makes a copy of a directory )

23
New cards

rm -i

asks for permission before removing

24
New cards

rmdir -r

removes any directory even if not empty

25
New cards

tail/head -n 5 filename

prints out first five lines of filename

26
New cards

echo –args–

just prints whatever args is

27
New cards

–args– > filename

puts the stdout of args into filename (rewrites filename)

28
New cards

–args– » filename

adds to filename on newline

29
New cards

wc filename

returns the number of lines words and characters in filename

30
New cards

wc (no args)

you type what you want, press CNTRL + D, returns number of lines words and characters you wrote

31
New cards

<

pipes in stdin or whatever

32
New cards

arg1 | arg2

pipes stdout of arg1 into stdin of arg 2

33
New cards

wc < filename

returns word count of filename

34
New cards

?

when used in a filename, stands for any character

35
New cards

*

stands for any length string of characters

36
New cards

- -

doesn’t eval next thing

37
New cards

diff file1 file2

displays the differences between file1 and file2. > is things in file2. < is things in file1

38
New cards

grep string file

search for “string“ in file

39
New cards

ls | grep html, cat file1 file2 | grep ‘hello world‘

use grep to find all html files, use it to find all instances of ‘hello world‘ in file1 file2

40
New cards

file file1

determines type of file1

41
New cards

whoami

print out username

42
New cards

id

it prints out the id numbers related to your username and group, and then it prints out all groups that you are in. ex:

uid=25324708(ehs72) gid=25324708(ehs72) groups=25324708(ehs72),20166(202501_cpsc.201.01-student)

43
New cards