Question

In: Computer Science

Lab 1-Refreshing Linux basics Objective: (Complete using Netlab) Please try each command in Linux system, and...

Lab 1-Refreshing Linux basics

Objective: (Complete using Netlab)

Please try each command in Linux system, and get screenshots (you may put multiple commands in one screenshot) which can show how actually each command runs. Also, give a brief description (one or two sentences) for each command. For the commands which have multiple switches/parameters, please try one popular switch/parameter.

If after the command, there is “date”, please run date to show the system date and time before you run the command; but if there is “name”, please type your first and last name, such as “Levis (First name)   Johnson (Last Name)” before you run this command. Your screenshot must include the above information.

Linux Commands

grep (date), find, man, ls , chmod, chown (name), passed, useradd and adduser, su, vi, rmdir (date), wherein, lsmod, insmod (name), make, | pipe, ln, rm, cp, mv, (name), ld, ftp, more, less, cat (date), tar, top , ps (name), kill, df, last, patch, mkdir (date)

Solutions

Expert Solution

1. Grep( date ) :
   grep "$(date +"%Y-%m-%d")" file


2.Find
   find [where to start searching from] [expression determines what to find] [-options] [what to find]
eg: find ./GFG -name sample.txt


3.Man
The man command displays the “man pages” for a command in less . The man pages are the user manual for that command. Because man uses less to display the man pages, you can use the search capabilities of less.

For example, to see the man pages for chown, use the following command:

man chown
Use the Up and Down arrow or PgUp and PgDn keys to scroll through the document. Press q to quit the man page or pressh for help.

4. ls

This might be the first command the majority of Linux users meet. It lists the files and folders in the directory you specify. By default, ls looks in the current directory. There are a great many options you can use with ls , and we strongly advise reviewing its the man page. Some common examples are presented here.

To list the files and folders in the current directory:

ls
To list the files and folders in the current directory with a detailed listing use the -l (long) option:

ls -l
To use human-friendly file sizes include the -h (human) option:

ls -lh
To include hidden files use the -a (all files) option:

ls -lha

5. chmod

The chmod command sets the file permissions flags on a file or folder. The flags define who can read, write to or execute the file. When you list files with the -l (long format) option you’ll see a string of characters that look like

-rwxrwxrwx
If the first character is a - the item is a file, if it is a d the item is a directory. The rest of the string is three sets of three characters. From the left, the first three represent the file permissions of the owner, the middle three represent the file permissions of the group and the rightmost three characters represent the permissions for others. In each set, an r stands for read, a w stands for write, and an x stands for execute.

If the r, w, or x character is present that file permission is granted. If the letter is not present and a - appears instead, that file permission is not granted.

One way to use chmod is to provide the permissions you wish to give to the owner, group, and others as a 3 digit number. The leftmost digit represents the owner. The middle digit represents the group. The rightmost digit represents the others. The digits you can use and what they represent are listed here:

0: No permission
1: Execute permission
2: Write permission
3: Write and execute permissions
4: Read permission
5: Read and execute permissions
6: Read and write permissions
7: Read, write and execute permissions
Looking at our example.txt file, we can see that all three sets of characters are rwx. That means everyone has read, write and execute rights with the file.

To set the permission to be read, write, and execute (7 from our list) for the owner; read and write (6 from our list) for the group; and read and execute (5 from our list) for the others we’d need to use the digits 765 with the chmod command:

chmod -R 765 example.txt


Related Solutions

(Complete Using Ubuntu) Please try each command in Linux system, and get screenshots (you may put...
(Complete Using Ubuntu) Please try each command in Linux system, and get screenshots (you may put multiple commands in one screenshot) which can show how actually each command runs. Also, give a brief description (one or two sentences) for each command. For the commands which have multiple switches/parameters, please try one popular switch/parameter. Linux Commands: rm,cp ,mv (name), ld, ftp, more, less, cat (date), tar, top, ps (name), kill, df, last, patch, mkdir (date)
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how...
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how to create user accounts Understand how to create group accounts Creating good password policies Understanding permissions and file sharing Setup: You will need a Ubuntu Server VM Walk Through: You are a system administrator who has been tasked to create user accounts for new users on your system. You can pick whatever theme you like as long as there are protagonist and antagonist users:...
Linux Directories, File Properties, and the File System in C Your version of find command Try...
Linux Directories, File Properties, and the File System in C Your version of find command Try running the find command in the shell and observe the output. Try it in different folders to make sure you understand what it prints out. $ find Write your version of the find command and add comments.
please use linux or unix to complete Diff command The diff command displays differences between two...
please use linux or unix to complete Diff command The diff command displays differences between two files on a line-by-line basis. It displays the differences as instructions that you can use to edit one of the files ( using the vi editor) to make it the same as the other. When you use diff, it produces a series of lines containing Append (a), Delete (d), and Change (c) instructions. Each of these lines is followed by the lines from the...
How LUNCH meterpreter in Kali Linux. Complete command please. Thank you
How LUNCH meterpreter in Kali Linux. Complete command please. Thank you
Lab – Linux Fundamentals Instructions: Using Kali Linux, the Windows Linux Sub-System, or another Debian based...
Lab – Linux Fundamentals Instructions: Using Kali Linux, the Windows Linux Sub-System, or another Debian based Linux distribution, perform the following tasks based on the Linux Fundamentals lecture. For this lab, take screenshots for all major steps completed to illustrate that each task was successfully completed (the same method as would be used for other labs). 9. Display your current directory in the terminal 10. Display your current directories contents including the inode value and permissions for each file and...
Using Linux in VirtualBox To display your system date: Type date in the command line, and...
Using Linux in VirtualBox To display your system date: Type date in the command line, and press Enter. What do you see?                                            You might see the abbreviation EDT (Eastern Daylight Time) instead of EST (Eastern Standard Time), or another time zone abbreviation, such as MDT (Mountain Daylight Time) or CST (Central Standard Time). Notice also that UNIX/Linux uses a 24-hour clock. Type Date in the command line, and press Enter. What error do you see?                                    The system error...
unix/Linux Create a tar command using the man command and the link referred to in To...
unix/Linux Create a tar command using the man command and the link referred to in To Practice and Explore: Text File Utilities #9. Preliminaries Use the man pages to learn more about tar Review the links referred to in To Practice and Explore: Text File Utilities #9 to see examples of using tar command Perform Use tar "to stuff" three files and then "unstuff" them into a new directory. Include the -v option. Task ll to show the original 3...
the Unix/Linux commands Enter the “date” command to print the current date and time. Also, try...
the Unix/Linux commands Enter the “date” command to print the current date and time. Also, try the “cal” command. Enter the command “clear” to clear the screen. Use the command “cat .bash_hisrtory” to view your startup file. Note that each shell has a different startup file, and since we’re using the BASH (Bourne-Again Shell), the startup file is .bash_history. (if you can’t find this file think about one way to display!) Enter the “exit” command to close the terminal window....
Linux Basics 1.In Linux what is a Window Manager –name a window manager that is commonly...
Linux Basics 1.In Linux what is a Window Manager –name a window manager that is commonly used? 2.If you were in a organisation that wanted to run a commercially backed distribution of Linux which one would you pick? 3.After the kernel is invoked at boot time, describe what happens? 4.Why is it common practice to use a boot loader? 5.Name two loaders used in Linux? 6.What is systemd? How is it used? 7.What does systemdreplace? Why was the choice made...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT