uli101_week5_practice
.docx
keyboard_arrow_up
School
Seneca College *
*We aren’t endorsed by this school
Course
101
Subject
Computer Science
Date
Dec 6, 2023
Type
docx
Pages
3
Uploaded by ChancellorDragonfly3067
ULI101 Redirection / Issuing Multiple Linux Commands
_____________________________________________________________________________
When answering Linux command questions on this side or the back side of this page, refer to
the following Inverted Tree diagram. The
linux
directory is contained in your
home directory.
Assume that you just
logged into your
Matrix
account. Directories are underlined
.
linux
|--
content
|
|--
assignments
|
`--
tests
|
|-- .answers.txt
|
`-- questions.txt
|--
projects
Questions:
1.
Write a single
Linux command to provide a detailed listing of all files in the /bin directory,
sending the output to a file called listing.txt in the “projects” directory.
(append output to existing file and use a relative pathname)
ls -l
/bin >
linux/projects/listing.txt
2.
Write a single
Linux command to redirect the stderr from the command:
cat a.txt b.txt c.txt to a file called error.txt contained in the “assignments” directory.
(overwrite previous file’s contents and use only relative pathnames)
cat a.txt b.txt c.txt 2> linux/content/assignments/error.txt
3.
Write a single
Linux command: cat ~/a.txt ~/b.txt ~/c.txt and redirect stdout
to a file called
“good.txt” to the “tests” directory and stderr
to a file called “bad.txt” to the “tests” directory.
(overwrite previous contents for both files and use only relative-to-home pathnames)
cat ~/a.txt ~/b.txt ~/c.txt > ~/linux/content/tests/good.txt 2> ~/linux/content/tests/bad.txt
4.
Write a single
Linux command to redirect the stdout from the command:
cat a.txt b.txt c.txt to a file called wrong.txt contained in the “projects” directory and
throw-out
any standard error messages so they don’t appear on the screen.
(append output to existing file and use only relative pathnames)
cat a.txt b.txt c.txt > linux/projects/wrong.txt 2> /dev/null
5.
Write a single
Linux pipeline
command to display a detailed listing of the “projects “directory
but pause one screen at a time to view and navigate through all of the directory contents.
1
PAGE
ULI101 Redirection / Issuing Multiple Linux Commands
_____________________________________________________________________________
Use a relative-to-home pathname.
ls -ld linux/projects | less
6.
Write a single
Linux pipeline
command to display the sorted contents (in reverse alphabetical
order) of the “linux” directory. Use a relative pathname.
ls linux | sort -r
7.
Assume that the text file called “.answers.txt” contains 10 lines. Write a single
Linux pipeline
command to only displays lines 5 through 8 for this file. Use only relative pathnames.
cat linux/content/tests/.answers.txt | head -n 8 | tail -n 4
8.
Write a single
Linux
pipeline
command to only display the contents of the “assignments”
directory whose filenames match the pattern “murray” (both upper or lowercase).
Use an absolute pathname.
9.
Write a single
Linux pipeline
command to display the number of characters
contained in the
file called “.answers.txt”. Use a relative-to-home pathname.
cat ~/linux/content/tests/.answers.txt | wc -c
10.
Write a single
Linux pipeline
command to display the number of lines
contained in the file
called “questions.txt”. Use a relative pathname.
cat linux/content/tests/questions.txt | wc -l
11.
Write a single
Linux pipeline
command
to display only the first 10 characters
of each filename
contained in your current directory. Also, there is will be a lot of output, so also pause at each
screenful so you can navigate throughout the display contents. Use a relative pathname.
2
PAGE
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Fill in the blank question- Only answer needed without explanation
Q. chmod command is used to ___________ the permissions of files in linux.
arrow_forward
explain the purpose of each command that are used on Linux.
• dir -a
• dir -A
• dir -F
• dir -l
• dir -h
• dir -r
• dir -S
• find
• chmod
• du
arrow_forward
Task:Write bash scrip to test all Athematic and logical
operators in Linux
Operator: Task
Script
Output
+: add two
number
-: make
decrement
operator
: Mutiply
negative and
positive number
1: divide any
numberby zero
Less than:
Compare two
value
Greaterthan:
Compare two
value
EquUniversityty:
Compare two
value
Not equal:
Compare two
value
arrow_forward
What is meant by the expression “less is more” when applied to the use of the Linux commands more and less.
arrow_forward
Fill in the blank question- Only answer needed without explanation
Q. ________________ file helps you configure kernel parameter in linux.
arrow_forward
Many Linux commands function identically to their counterparts in Linux, yet this phenomenon begs the questions of why and how.
arrow_forward
The common technique used for protecting a critical section in Linux is the
arrow_forward
Last Stage of Delirium, a security study organisation, created some clean portbinding shellcode for Linux. Shellcode that is clean is shellcode without any NULL symbols. As was already stated, NULL characters prevent the majority of buffer overflow vulnerabilities from being exploited properly because the function stops copying when a NULL byte is encountered. E
arrow_forward
What are cron jobs and how are they scheduled in Linux?
arrow_forward
Fill in the blank question- Only answer needed without explanation
Q. __________ command is used to delete the file including sub-directories in linux.
arrow_forward
There are a great number of Linux commands that do precisely the same actions as they do in Linux; nevertheless, it is not clear why or how this occurs.
arrow_forward
https://raw.githubusercontent.com/nuwanarti/Assignment1/main/data1
using Bash
arrow_forward
In your Linux terminal/prompt (as the root user), create a log file. The log file should include the following information:
• The time when the log file is created
• The user who creates the log file
• How long has the system been running
• CPU model name
• CPU frequency
• CPU architecture
• OS kernel name
• OS kernel release
• Memory usage
• Disk usage
(use cat command to open the file)
arrow_forward
Given a linux file mode (permissions) as an integer, return the permission string that the mode represents.
Example 1:
mode = 511
511 == Ob111111111
permissons = 'rwxrwxrwx'
Example 2:
mode = 424
424 == ob110101000
permissions = 'rw-r-x---'
def perms(mode):
pass
arrow_forward
Question v .You are a new Linux user who has just started working with the terminal. You have been given a task by your supervisor to organize report.txt on your computer. In your response, answer the following: Give me a list of five Linux terminal commands used to update the file report.txt on your computer.
Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this line
arrow_forward
do all please
arrow_forward
Name of Experiment: Terminal - A Command Line Interface
Goal: Interaction with Linux through Command Line Interface.
**Execute the below commands step by step and take a snapshot of the executed**.
ls - list the contents in the directory
Usage: ls <directory>
cd - change directory
Usage: cd <directory>
pwd - Present working directory
Usage: pwd
mkdir - Make a directory
Usage: mkdir <directory>
5) rmdir - Remove a directory
Usage: rmdir <directory>
6) rm - is a command utility used to remove files and directories
Usage: rm [OPTIONS] FILE
7) mv - is a command used to move files and directories.
Usage: mv [OPTIONS] SOURCE DESTINATION
- The source can be one or more files but the destination should be a
single file or directory
- If you define a single file as SOURCE, and the destination target is
existing directory, then file is moved to the specific directory.
- If you specify a…
arrow_forward
Course: Linux Operating System in Security
To be correct the command must work on a Kali Linux 2021.4a install; when the command is copy and pasted. This does include syntax and letter case.
Q 1: The user testuser1 need to be able to invoke sudo what command or commands do you need to run to put testuser1 in the sudoers file?
arrow_forward
A number of concurrent methods included in Linux are unique to Linux and cannot be found in other operating systems.
arrow_forward
Please help with the following: In Linux
Using the following format describe the followiing commands
Format
Command. Description. Explored Options. Log
tail (n)exitpasswdwho, wwhatis
ln (-s) file (-f)
arrow_forward
Describe and separate different ways of scheduling Linux commands to be run in the future, such as:
arrow_forward
Load average is an estimate of how busy a Linux system is. Write the command that can be used to display load average values of a running system.
the command answer is uptime
arrow_forward
Implement the following commands on Linux and explain the purpose of each command with the
screenshot of the output.
dir -a
dir -A
dir -F
dir -l
dir -h
dir -r
dir -S
• find
chmod
du
arrow_forward
How can I fix this error when I run the script?
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L
Related Questions
- Fill in the blank question- Only answer needed without explanation Q. chmod command is used to ___________ the permissions of files in linux.arrow_forwardexplain the purpose of each command that are used on Linux. • dir -a • dir -A • dir -F • dir -l • dir -h • dir -r • dir -S • find • chmod • duarrow_forwardTask:Write bash scrip to test all Athematic and logical operators in Linux Operator: Task Script Output +: add two number -: make decrement operator : Mutiply negative and positive number 1: divide any numberby zero Less than: Compare two value Greaterthan: Compare two value EquUniversityty: Compare two value Not equal: Compare two valuearrow_forward
- What is meant by the expression “less is more” when applied to the use of the Linux commands more and less.arrow_forwardFill in the blank question- Only answer needed without explanation Q. ________________ file helps you configure kernel parameter in linux.arrow_forwardMany Linux commands function identically to their counterparts in Linux, yet this phenomenon begs the questions of why and how.arrow_forward
- The common technique used for protecting a critical section in Linux is thearrow_forwardLast Stage of Delirium, a security study organisation, created some clean portbinding shellcode for Linux. Shellcode that is clean is shellcode without any NULL symbols. As was already stated, NULL characters prevent the majority of buffer overflow vulnerabilities from being exploited properly because the function stops copying when a NULL byte is encountered. Earrow_forwardWhat are cron jobs and how are they scheduled in Linux?arrow_forward
- Fill in the blank question- Only answer needed without explanation Q. __________ command is used to delete the file including sub-directories in linux.arrow_forwardThere are a great number of Linux commands that do precisely the same actions as they do in Linux; nevertheless, it is not clear why or how this occurs.arrow_forwardhttps://raw.githubusercontent.com/nuwanarti/Assignment1/main/data1 using Basharrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.Computer ScienceISBN:9781337569798Author:ECKERTPublisher:CENGAGE L
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L