HW2 Section:
echo $SHELL identifies the file path that holds the shell's data files.
pwd -> shows current work directory
ls -> lists the folders/files in the current directory (excludes hidden files)
ls -l -> lists detailed information about all of the files, including hidden files, in the current directory
(Try 'ls --help'. What is the given description of the '-l' option? What about '-h'? Try 'ls -l -h'. How is this different than just 'ls -l'?) -> -l option displays the contents of a directory in a long list format. the -h parameter made the file sizes more human friendly, such as calling the 4096 byte folder a 4.0 kilobyte folder.
mkdir new_directory -> creates a new directory in the current working directory
ls -> lists files in current working directory
cd new_directory -> moving to the newly created directory called new_directory
pwd -> verifying that we are working inside of new_directory
ls -> listing the contents of the folder
ls .. -> listing the contents of the PREVIOUS folder (indicated by ..)
cd .. -> moving to the PREVIOUS directory
pwd -> identifying that we moved back into CMSSW_5_3_32
ls -> listing the files of the directory
rmdir new_directory -> deleting new_directory
ls -> listing the files in CMSSW_5_3_32
(Now try hitting the up arrow. Hit it again) -> running the 'rmdir new_directory' command after it was deleted to confirm it was deleted via receiving an error message
ls –CFx /usr/bin -> lists the files that are in the user's root directory. It also appends a special character to the end of the file name as to indicate that there are files inside of those directories. Printed in reverse-alphabetical order
ls –l /bin -> similar to the one above but without some formatting and the special character at the end of the directory/file list. Printed in alphabetical order
find /usr –name “*g++*” –print -prints all of the files that contain the phrase in quotation marks
which g++ ->lists where entries containing g++
Try typing “ls /home/cms” and then hitting the “tab” key (before hitting return). -> pressing tab finished the command for me
whoami -> tells you what account you are logged in as
echo ~ -> printed the file path to the home directory
ls ~ -> listed the files inside of the home directory
cd ~ -> changed to the home directory
pwd -> printed the current work directory
cd ~ -> changed to the root directory
mkdir TEST -> created a directory called test
(Try typing 'cd TE' and hitting tab, then 'Enter' to move into the new directory.) -> hitting tab completed the command for me
touch file1 file2 test1 test2 -> created files with the corresponding names
ls -> listed the contents of TEST directory
find . -name "test*" -> found all files that begun with test
find . -name "file*"-> found all files that begun with file
find . -name "*1" -> found all files that ended with 1
find . -name "*2" -> found all files that ended with 2
rm file1 file2 test1 test2 -deleted all of the files inside of TEST
ls -> listed the contents of the empty folder
(I deleted TEST as there is no purpose to it outside of this exercise)
HW3
This script parses through all of the VM's system files and prints all of which contain the phrase that is passed into the script. Running the command for all files containing cms would be the following:
tcsh ./testscript.tcsh cms
The following commands are illustrating file permissions, showing what can and cannot be ran by command prompt depending on what permissions are set on files:
./testscript.tcsh cms
ls –l testscript.tcsh
chmod +x testscript.tcsh
ls –l testscript.tcsh
./testscript.tcsh cms
The result of the above code is the same as the previous exercise.
HW4
After running the g++ -dumpspecs command, the version of c++ is embedded in a long stream of characters. It is identified here: