1) Write a Unix command that will display the
message below using echo and the value of your
environment variable instead of the sample student login
/students/astud01
My home directory is
/students/astude01
2) Write a Unix command to display your
login and the system date with both commands on
one line (the output may be on separate lines)
SAMPLE OUTPUT (details will differ):
cconner
Tue Jul 7 15:38:44 PDT 2015
3) 1.Write a Unix command that will redirect
(>) the results of the server name into the
file called temp1
Note: no output is produced
2. Write a Unix command that will append the uptime of the server
to the same file called temp1
Note: no output is produced
4) Write a Unix command that will display the
contents of (concatenate) the file called temp1
Note: the contents of temp1 should look something
like this (but your uptime will differ):
hills
8:51am up 20 days, 18:44, 1 user, load average: 0.01, 0.01,
0.03
5) Using a pipe, Write a Unix command that will paginate (using pr) the output of the who command to 20 lines per page, 2 columns with line numbering. Below is sample output but your details will differ and Canvas upsets the formatting:
2015-07-07
15:39
Page 1
1 gboyd
pts/1 2015-
9 jhenry7 pts/10
2015-
2 cconner
pts/0
2015- 10 malva106 pts/12
2015-
3 jhenry7
pts/2
2015- 11 jbettiz pts/13
2015-
4 ibulygin
pts/3
2015- 12 tpham44 pts/14
2015-
5 gboyd
pts/5
2015- 13 bbotella pts/15
2015-
6 dputnam
pts/6
2015- 14 ibulygin pts/17
2015-
7 tmurray7
pts/7
2015- 15 ahapp
pts/18 2015-
8 gboyd
pts/9
2015-
Answer 1
*********
echo "My home directory is " $HOME
Answer 2
*********
whoami ; date
Answer 3
********
hostname > temp1
uptime >> temp1
Answer 4
*********
cat temp1
Answer 5
*********
who
i have only one user so this command can not execute so simply who | pr could solve your problem
if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)
1) Write a Unix command that will display the message below using echo and the value...
Explain what the following UNIX command does: Is 'echo I.txt' Please type shell commands (for Windows. UNIX, or any other system that you like) for: creating a directory called hello world list the contents of this directory create a file called iwashere.txt display the contents of the file iwashere.txt from the command-line Please write a simple program in C for accepting a string from the command-line, reversing and printing the reversed string to standard output.
QUESTION 1 What will be the output of following Unix command: find / -name ‘*’ A. List all files and directories recursively starting from / B. List a file names * in / C. List all files in / directory D. List all files and directories in / directory QUESTION 2 Which command is used to extract a column/field from a text file / input. A. paste B. get C. cut D. tar QUESTION 3 Which command creates an empty...
1.Write a find command that will display the inode number of all files in the working directory (only) that contain the string "#include". 2.Write an ls command with a glob specification that will list the names of all files in the working directory that are exactly 10 characters long, begin with w, x, y, or z, and do not contain a "." character (i.e. no file extension). 3.Write an ls command with a glob specification that will list the names...
Using Unix/Linux Command line in terminal and C programming. (b) Write a basic C program contained in a1q4.c and perform the following tasks in your program’s main() function: (8 marks) • Declare and initialize at least one variable of these types: char, int, unsigned int, float, double and long double. When initializing your variables, ensure the constants you use are of the same type as your variable. See the “Constants” section of Topic 7 for more information. • Use printf(3)...
Writing Unix Utilities in C (not C++ or C#) my-cat The program my-cat is a simple program. Generally, it reads a file as specified by the user and prints its contents. A typical usage is as follows, in which the user wants to see the contents of my-cat.c, and thus types: prompt> ./my-cat my-cat.c #include <stdio.h> ... As shown, my-cat reads the file my-cat.c and prints out its contents. The "./" before the my-cat above is a UNIX thing; it...
LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check the output) Display the command(s) used to do the following: create an empty file called history by using just a redirection operator. Verify and show. Show/verify all results (i.e., all commands and their corresponding outputs). Wait 1 minute or more and then display the command(s) used to do the following: change the timestamp on the history file you just created. Verify/display the change. Show/verify...
Most system administrators would like to know the utilization of their systems by their users. On a Linux system, each user's login records are normally stored in the binary file /var/log/wtmp. The login records in this binary file can not be viewed or edited directly using normal Linux text commands like 'less', 'cat', etc. The 'last' command is often used to display the login records stored in this file in a human readable form. Please check the man page of...
Unix/Linux The purpose of this lab is to practice the commands to manage and organize files and directories: How would one go about this? Thanks. Task 1: Preliminaries: 1) If you have not already done so, create a directory called bin under your HOME directory. 2) If you have not already made a copy (using ftp) of the file called famous.dat from the Assignment#1, do that now. 3) Make bin the active/working directory. Task 2: Perform all of the following...
use JOptionPane to display output Can someone please help write a program in Java using loops, not HashMap Test 1 Grades After the class complete the first exam, I saved all of the grades in a text file called test1.txt. Your job is to do some analysis on the grades for me. Input: There will not be any input for this program. This is called a batch program because there will be no user interaction other than to run the program....