1. Navigate to your home directory by typing cd. Now type ls and
notice that there is a subdirectory called Downloads. Now navigate
to the root of the file system by typing cd /. From here, which
single command would you use to navigate directly to the Downloads
folder that is located in your home directory? The output of the
command would be as follows:
2. From the Downloads directory which single command would you use
to navigate back up one directory and then back down into the Music
directory?
Which command can you use to ensure you are located in the
home/sysadmin/Music directory?
3. Navigate back to your home directory. Which single command would
you use to get a listing of all the files in that directory,
including the hidden files, that also lists additional information
about the files such as the time they were last modified and the
files permissions? Partial output of the command would appear as
follows:
4. Navigate to your Documents directory and type touch myfile. Now
navigate back to your home directory. From here what command would
you use to get a listing of all the files in the Documents
directory? The output of this command would appear as
follows:
5. Navigate to the /home directory. From here what command would
you use to get a listing of the contents of this directory, as well
as all the contents of all the subdirectories? The output of this
command would appear as follows:
6. Navigate to your home directory. From here what single command
would you use to display all the files that begin with “Pi” or
“Vi”? The output of this command would appear as follows:
7. What command would you use to make a copy of the passwd file
in the /etc directory and save it in your home directory as a file
called mypasswd? When you do a file listing after the command you
should see something similar to the following:
8. What command would you use to copy all the files in the /etc
directory that start with the letter “s” and end with the letter
“s” to your home directory? When you do a file listing after the
command you should see something similar to the following:
9. What command would you use to delete all the files in your home
directory that consist of exactly eight (8) characters? When you do
a file listing after the command you should see something similar
to the following:
10. What command(s) would you use to copy all the files in the /etc
directory, including all the files in subdirectories underneath
/etc, to a new directory in your home directory called MyEtc while
also telling you what is being done as it happens? When you do a
file listing after the command you should see something similar to
the following:
11. In your home directory, create a file called thefile by
entering the command touch thefile. What command would you use to
rename thefile to afile? When you do a file listing after the
command you should see something similar to the following:
12. What single command would you use to make a duplicate copy of
afile called yourfile? When you do a file listing after the command
you should see something similar to the following:
13. What single command would you use to delete both afile and
yourfile at the same time? When you do a file listing after the
command you should see something similar to the following:
ANSWER:
1. Navigate to your home directory by typing cd. Now type ls and notice that there is a subdirectory called Downloads. Now navigate to the root of the file system by typing cd /. From here which command would you use to navigate directly into the Downloads folder that is located in your home directory?
cd home/
ls
cd Downloads/
2. From the Downloads directory which single command would you use to navigate back up one directory and then back down into the Music directory?
cd ..
cd Music/
Which command can you use to ensure you are located in the Music directory?
pwd
3. Navigate back to your home directory. Which single command would you use to get a listing of all the files in that directory, including the hidden files, that also lists additional information about the files such as the time they were last modified and the files permissions?
cd
ls –la | more
4. You should still be in your home directory. From here what command would you use to get a listing of all the files in the Documents directory?
ls –la /home/Documents
5. Navigate into the /home directory. From here what command would you use to get a listing of the contents of this directory, as well as all the contents of all the subdirectories?
cd
ls -R /home/
6. Navigate to your home directory. From here what command would you use to display only the files that begin with “Mi” or “Pi”?
cd
ls Mi*
ls Pi*
7. What command would you use to make a copy of the passwd file in the /etc directory and save it in your home directory as a file called PasswordFile?
cp /etc/passwd home/PasswordFile
8. What command would you use to copy only the files in the /etc directory that start with the letter “l” and end with the letter “e” into your home directory?
cp /etc/I*e /home/
9. What command would you use to delete only the files in your home directory that consist of exactly 9 characters?
rm /home/?????????
10. What command would you use to copy all the files in the /etc directory to a new directory in your home directory call MyEtc while also telling you what is being done as it happens?
cp /etc/* /home/MyEtc/
11. Create a file called “myfile” by entering the command touch myfile. What command would you use to rename this file to “yourfile”?
touch myfile
mv myfile yourfile
12. What command would you use to make another copy of “yourfile” called “ourfile”?
cp yourfile ourfile
13. What command would you use to delete both “yourfile” and “ourfile” at the same time?
rm –rf yourfile ourfile
1. Navigate to your home directory by typing cd. Now type ls and notice that there...
Step 2: Copy these three files in linux to your home directory, and confirm that they have been copied by listing the files in your directory along with their sizes : 1. The date file from the /bin directory. 2. The awk or gawk file from the /usr/bin directory. 3. The passwd file from the /etc directory.
1) Copy bother10.sh from /home/ghoffman/course_files/it244_files to your hw6 directory. Run this program in the background redirecting output to /dev/null. Be sure you copy and run bother10.sh, NOT bother.sh. 2) Run a command that shows the job number of the process running bother10.sh. 3) Run a command that shows the process ID of the process running bother10.sh. 4) Copy the script make_foo.sh from ~ghoffman/course_files/it244_files to your current directory. Run this script. Using touch, create the file foo.txt. Perform a long listing...
QUESTION 1 From YOUR home directory, execute a find command string that will locate the file called resolv.conf. Include the -exec flag in the find command to cat the file to the screen. Begin your find search from the letc directory. Select the correct find command string below that will accomplish this. find /etc -name 'resolv.conf-cat f} \; find /etc -name 'resolv.conf' -exec cat {} \; find . -name 'resolv.conf' -exec cat {} \; O find / -name 'resolv.conf' -exec...
QUESTION 1 From YOUR home directory, execute a find command string that will locate the file called resolv.conf. Include the -exec flag in the find command to cat the file to the screen. Begin your find search from the letc directory Select the correct find command string below that will accomplish this. find /etc-name 'resolv.conf -cat D find /etc-name 'resolv.conf -exec cat 0 find. -name 'resolv.conf -exec cat 0\ find /-name 'resolv.conf' -exec cat 0 QUESTION 2 What find command...
Using Ubuntu OS... help is greatly needed! Thank you. Create an alias called "home" that does two things... returns you to your home directory, then does a long listing of all files found there Create a file called "Output.txt" that contains the output of the "ls /etc" command Using "cat", create a file called "poem.txt" where you enter at least one line of text ("Mary had a little lamb" will do...) Using "cat", pipe the contents of poem.txt into the...
Open Command Prompt typing CMD command in your Search window. Change the directory from current to root (C:). Make a new directory called CIS165_Your Last Name (example: CIS165_Nossa). Within this directory, make subdirectories called Can1 and Can2. Verify the created directory and subdirectories using particular command. Under Can1 subdirectory creates three files called Jam.txt, Milk.txt and Juice.txt. Verify that you created these files using particular command. Move Jam.txt file from the Can1 subdirectory to the Can2 folder. Compare using special...
Question 1) Copy file called sortfile from my home directory. The file contains three columns of information : username, uid number and group name respectively, separated by a field separator. Will the following command sort the file on the group name field? sort -t! -k3 sortfile A) Yes B) No Question 2) Copy the file called sortfile from my home directory. The file contains three columns of information : username, uid number and group name respectively, separated by a field...
Suppose that you wished to copy all of the text files from your fileAsst directory and all of the files from your fileAsst/Planes directory into your current directory (without typing out the name of each individual file). What command would you give to make that copy?
1. Set up an easy way to copy files from /home/distribution/cnguyen/cis18b directory on voyager, without having to type the long path name every time. Make your set up “permanent” for this quarter (the set up should last from one login session to another). 2. Use echo to write a brief explanation of your set up in step 1. 3. If you are not at your home directory, go to your home directory and don’t change directory for the rest of...
Really need help from 11 on: Create the directory structure IFT383FinalExam/Activities/Activity1 in your home directory. Using the cat command, create a file named classRoster with the following fields, separated by a comma. Student ID First Name Last Name Grade Program of Study ASURITE ID (username) Add three records to your file. Display the contents of the file. Move the file classRoster to the directory Activity1. Go to the Activity1 directory. Display the directory you are in. Add read, write and...