Question

Using Ubuntu OS... help is greatly needed! Thank you. Create an alias called "home" that does...

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 "wc" command to count the number of words
  • Using "cat" and "grep", display only the lines in /etc/passwd that has contain your user name
  • Display the last 5 lines of the /etc/passwd file
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. code

note: alias store command as variables and execute it on entring alias keyword

alias home='cd ~/; ls -l'

home

code snippet:

anupam@anupam:~$ alias home='cd ~/; ls -l'
anupam@anupam:~$ home
total 1452392
drwxr-xr-x 2 anupam anupam 4096 Aug 20 03:23 '{'$'\177'
-rw-rw-r-- 1 anupam anupam 80564 Jan 21 22:04 0001015090005725058_01132020_02022020.PDF
-rw-rw-r-- 1 anupam anupam 88478 Jan 21 06:10 0183d9dd-cc51-4d47-a43d-6662b56f009c.jpeg
-rw-rw-r-- 1 anupam anupam 96850 Feb 3 11:25 05370021-0a83-43c2-ba3c-bf319e5b6fa7.jpeg
-rw-rw-r-- 1 anupam anupam 304 Feb 5 22:04 1
-rw------- 1 anupam anupam 46092 Jan 28 12:41 1111111111111.pdf

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

command:

redirecting output to a file

ls /etc/ << Output.txt

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

writing to a file

command

cat >poem.txt

type your text and press ctrl +d


head poem.txt

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

counting words from a file

code :

cat poem.txt | wc -w

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

searching for a keyword in a output

anupam@anupam:~$ cat /etc/passwd |grep 'anupam'
anupam:x:1000:1000:anupam,,,:/home/anupam:/bin/bash

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

displaying last lines of a output

code:

anupam@anupam:~$ tail -5 /etc/passwd
geoclue:x:118:124::/var/lib/geoclue:/usr/sbin/nologin
gnome-initial-setup:x:119:65534::/run/gnome-initial-setup/:/bin/false
gdm:x:120:125:Gnome Display Manager:/var/lib/gdm3:/bin/false
anupam:x:1000:1000:anupam,,,:/home/anupam:/bin/bash
cups-pk-helper:x:121:116:user for cups-pk-helper service,,,:/home/cups-pk-helper:/usr/sbin/nologin

Add a comment
Know the answer?
Add Answer to:
Using Ubuntu OS... help is greatly needed! Thank you. Create an alias called "home" that does...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Really need help from 11 on: Create the directory structure IFT383FinalExam/Activities/Activity1 in your home directory. Using...

    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...

  • Login to Suse Linux as root. Complete the task working as the root user. 1. What...

    Login to Suse Linux as root. Complete the task working as the root user. 1. What is your current directory. What did you enter at the command prompt to determine your current working directory? 2. Change directories if needed to find your foods (or food) file. Use vi to make the file contain 10 food items. Save your file and quit. Use the cat command, and option, and the argument food to display the food file with numbered lines. Use...

  • QUESTION 1 From YOUR home directory, execute a find command string that will locate the file...

    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...

  • 1. Navigate to your home directory by typing cd. Now type ls and notice that there...

    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...

  • Create a new file and create a hard link and a symbolic link to it. Use...

    Create a new file and create a hard link and a symbolic link to it. Use vim or redirection to add content of the original file, then use cat and wc to examine each of the two aliases that you created. How does the result prove or disprove that either alias is a copy of the original file? In your home directory create a hard link and a symbolic link to one of the commands that you know how to...

  • Manipulate directory structures in Unix/Linux Use the OS that you set up from Question 1. Assume...

    Manipulate directory structures in Unix/Linux Use the OS that you set up from Question 1. Assume you are started at your home directory. Perform a command that displays the absolute path of your home directory (your current location). Create a new directory inside your home directory and name it “Assignment-3” Without moving into the directory you just made (staying in your home directory), create two new directories using one command inside of the Assignment-3 directory, and name them Test1 and...

  • In this exercise, you will create a script called file_ops.sh that uses the various file operators...

    In this exercise, you will create a script called file_ops.sh that uses the various file operators The file_ops.sh script will Use one command line argument Use four IF THEN statement to compare the first command line argument Determine which file operators to use that produces the following output when the script run with the arguments shown WARNING: In the IF THEN statements, to avoid syntax error messages, there must be a space before and after each bracket and also between...

  • write the following code using C language. It will be ran in Ubuntu running linux OS...

    write the following code using C language. It will be ran in Ubuntu running linux OS 2 File Management System Write a basic file managment system with following capabilities. Suppose the name of the program is myFS. When it executes as below: myFS Is - /home Figure 6 : First command format The program should provides the file listing of the given directory. The program should list the filename, file size, and time last modified for each file within the...

  • You are to create and apply a firewall rule set on your Ubuntu server and each...

    You are to create and apply a firewall rule set on your Ubuntu server and each rule should be commented. Make sure to use variables for the IP addresses in your firewall. It's good practice and if I have to test one or more of your rules, I can replace the address in the variable. For any packets you REJECT or DENY, those should be logged. That means you'll need to modify the rule so that if the rule matches...

  • Problem 1 Write a BASH script to create a user account from the Linux system on...

    Problem 1 Write a BASH script to create a user account from the Linux system on which your script is run. The script should process two positional parameters. First positional parameter is supposed to be a string with a user name (e.g., user_name) Second positional parameter is supposed to be a string with a user password (e.g., user_password) In your script: Check if two positional parameters were passed to your script when it was invoked If NOT, print an appropriate...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT