Command Prompts Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How to determine current Ruby Installed?

A

ruby -v

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

How to determine current Rails Installed?

A

rails –help

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

How to select the version of Ruby to use?

A

rvm use …version number

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

How do you create a local GIT for your app?

A

git init

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

How do you add files to local GIT?

A

git add . (the dot means the current open directory).

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

What does the (-m) mean in the following command code?

git commit -m “Rails Beginning App Created Status”

A

The (-m) means that we are adding a message to our git commit.

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

How do you see what the current status of GIT is?

A

git log

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

What does the following code result in?

rake routes

A

displays all of the url’s and methods available for use in the application.

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

pwd

A

print working directory

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

hostname

A

my computer’s network name

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

mkdir

A

make a new directory

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

cd

A

change directory

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

ls

A

list directory

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

rmdir

A

remove directory

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

popd

A

pop directory

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

cp

A

copy a file or directory

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

mv

A

move a file or directory

18
Q

less

example $ less file.txt

A

page through a file / will enter into file on the command prompt and will not return to prompt.
(enter q to quite out)

19
Q

cat

A

print the whole file

20
Q

xargs

A

execute arguments

21
Q

find

A

fine files

22
Q

grep

A

find things inside files

23
Q

man

A

read a manual page

24
Q

apropos

A

find what man page is appropriate

25
Q

env

A

look at your environment

26
Q

echo

A

print some arguments

27
Q

export

A

export/set a new environment variable

28
Q

exit

A

exit the shell

29
Q

sudo

A

DANGER! become a super user root DANGER!

30
Q

chmod

A

change permission modifiers

31
Q

chown

A

change ownership

32
Q

cd ..

A

go up one directory

33
Q

touch

exemple $ touch newemptyfile.txt

A

creates a new file

must name file

34
Q

more

example $ more file.txt

A

will display the file in the command prompt and then exit out to new command prompt

35
Q

cat newfile1.txt&raquo_space; newfile2.txt

A

will append info from file on left and append to file on right (permanent)

36
Q

ls .txt or ls ex.*

A

The * is a wildcard search item

37
Q

What does this command line input do?

find . -name “*.txt” -print | less

A

In directory . (or the current directory) find files with -NAMES that have a (wild card) .txt, the print file names to a new screen by using the less command

38
Q

cat > newfile1.txt

A

This will open a new prompt and then you type in what you wish to add to the file, then press command -d to exit out.

39
Q

grep thisword *.txt

A

searches for the word “thisword” in any file in the current directory that has the wild card .txt file ending.

40
Q

$ man find

does what?

A

search help files by typing “man”

examples: man find; man less; man man; man grep. must select q to quit out.