Command Prompts Flashcards
How to determine current Ruby Installed?
ruby -v
How to determine current Rails Installed?
rails –help
How to select the version of Ruby to use?
rvm use …version number
How do you create a local GIT for your app?
git init
How do you add files to local GIT?
git add . (the dot means the current open directory).
What does the (-m) mean in the following command code?
git commit -m “Rails Beginning App Created Status”
The (-m) means that we are adding a message to our git commit.
How do you see what the current status of GIT is?
git log
What does the following code result in?
rake routes
displays all of the url’s and methods available for use in the application.
pwd
print working directory
hostname
my computer’s network name
mkdir
make a new directory
cd
change directory
ls
list directory
rmdir
remove directory
popd
pop directory
cp
copy a file or directory
mv
move a file or directory
less
example $ less file.txt
page through a file / will enter into file on the command prompt and will not return to prompt.
(enter q to quite out)
cat
print the whole file
xargs
execute arguments
find
fine files
grep
find things inside files
man
read a manual page
apropos
find what man page is appropriate
env
look at your environment
echo
print some arguments
export
export/set a new environment variable
exit
exit the shell
sudo
DANGER! become a super user root DANGER!
chmod
change permission modifiers
chown
change ownership
cd ..
go up one directory
touch
exemple $ touch newemptyfile.txt
creates a new file
must name file
more
example $ more file.txt
will display the file in the command prompt and then exit out to new command prompt
cat newfile1.txt»_space; newfile2.txt
will append info from file on left and append to file on right (permanent)
ls .txt or ls ex.*
The * is a wildcard search item
What does this command line input do?
find . -name “*.txt” -print | less
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
cat > newfile1.txt
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.
grep thisword *.txt
searches for the word “thisword” in any file in the current directory that has the wild card .txt file ending.
$ man find
does what?
search help files by typing “man”
examples: man find; man less; man man; man grep. must select q to quit out.