Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is what i have from the first exercise and im unsure how to do the next one

ID: 3646552 • Letter: H

Question

Here is what i have from the first exercise and im unsure how to do the next one.

Who:If you want to know which users are currently logged in to your Linux system, which console they're using, and the date and time they logged in, issue the who command. You'll see output something like this:
who
root tty1 Nov 2 17:57
hermie tty3 Nov 2 18:43
sigmund tty2 Nov 2 18:08
In the output shown here, the term tty stands for teletype. In the olden days of computing, a terminal was just a keyboard with an attached printer, so you read everything off the teletype.
If you've logged in with multiple virtual consoles and changed your identity on any of them, you may have some trouble figuring out who you are--or at least what user is logged in to the console you're using. If you find yourself in such an identity crisis, try this related command:
whoami
The whoami command will tell you the name of the current user. Just as a side note, you can also use the who am i command (a variant of the who command) to return the name of the current user. But it doesn't always work s you might expect. If you're logged in as root, and use the su command to switch to another user, who am i will return"root" as the current user. For this reason, I recommend that you train yourself to always use the whoami command when you want to know the current user name.

Date:The date command under UNIX display date. It is also used to set date and time. You must be the super-user (root) to change the date and time.
UNIX Date Command Syntax
date date "+format"
Task: Display Current Date and Time
Type the following command:
date
Sample outputs:
Tue Oct 27 15:35:08 CDT 2009
Task: Set The Current Time
To set the current time to 05:30:30, enter:
date 0530.30
Task: Set Date
Set the date to Oct 25, 12:45 a.m., enter:
date 10250045

Cal displays a simple calendar. If arguments are not specified, the current month is displayed. The options are as follows:
-1
Display single month output. (This is the default.)
-3
Display prev/current/next month output.
-s
Display Sunday as the first day of the week. (This is the default.)
-m
Display Monday as the first day of the week.
-j
Display Julian dates (days one-based, numbered from January 1).
-y
Display a calendar for the current year.

Clear:Clears the screen.
Syntaxclear
Examples
clear
Clear the screen.
Additional information
Many newer Unix systems and Unix variants will also accept the cls command or have cls as an alias for clear

Ls:Lists the contents of a directory .
Syntax
ls [-a] [-A] [-b] [-c] [-C] [-d] [-f] [-F] [-g] [-i] [-l] [-L] [-m] [-o] [-p] [-q] [-r] [-R] [-s] [-t] [-u] [-x] [pathnames]
-a Shows you all files, even files that are hidden (these files begin with a dot.)
-A List all files including the hidden files. However, does not display the working directory (.) or the parent directory (..).
-b Force printing of non-printable characters to be in octal ddd notation.
-c Use time of last modification of the i-node (filecreated, mode changed, and so forth) for sorting (-t) or printing (-l or -n).
-C Multi-column output with entries sorted down the columns. Generally this is the default option.
-d If an argument is a directory it only lists its name not its contents.
-f Force each argument to be interpreted as a directory and list the name found in each slot. This option turns off -l, -t, -s, and -r, and turns on -a; the order is the order in which entries appear in the directory.
-F Mark directories with a trailing slash (/), doors with a trailing greater-than sign (>), executable files with a trailing asterisk (*), FIFOs with a trailing vertical bar (|), symbolic links with a trailing at-sign (@), and AF_Unix address family sockets with a trailing equals sign (=).
-g Same as -l except the owner is not printed.
-i For each file, print the i-node number in the first column of the report.
-l Shows you huge amounts of information (permissions, owners, size, and when last modified.)
-L If an argument is a symbolic link, list the file ordirectory the link references rather than the link itself.
-m Stream output format; files are listed across the page, separated by commas.
-n The same as -l, except that the owner's UID and group's GID numbers are printed, rather than the associated character strings.
-o The same as -l, except that the group is not printed.
-p Displays a slash ( / ) in front of all directories.
-q Force printing of non-printable characters in file names as the character question mark (?).
-r Reverses the order of how the files are displayed.
-R Includes the contents of subdirectories.
-s Give size in blocks, including indirect blocks, for each entry.
-t Shows you the files in modification time.
-u Use time of last access instead of last modification for sorting (with the -t option) or printing (with the -l option).
-x Displays files in columns.
-1 Print one entry per line of output.
pathnames File or directory to list.
Examples
ls -l
In the above example this command would list each of the files in the current directory and the files permissions, the size of the file, date of the last modification, and the file name or directory. Below is additional information about each of thefields this command lists.
Permissions Directories Group Size Date Directory or file
drwx------ 2 users 4096 Nov 2 19:51 mail/
drwxr-s--- 35 www 32768 Jan 20 22:39 public_html/
-rw------- 1 users 3 Nov 25 02:58 test.txt


Cd:Changes the directory .Syntax
cd [directory]
directory Name of the directory user wishes to enter.
cd .. Used to go back one directory on the majority of all Unix shells. It is important that the space be between the cd and the ..
cd - When in a Korn shell to get back one directory used to go back one directory.
Examples
cd hope
The above example would go into the hope directory if it exists.
cd ../home/users/computerhope
The above example would go back one directory and then go into the home/users/computerhope directory.
cd ../../
Next, the above example would go back two directories.
cd


Pwd:The pwd command displays the full pathname of the current directory.
The syntax for the pwd command is:
pwd
* Please note that there are many flavors of UNIX,so if in doubt, consult your man pages.


Man:The man command is short for manual and provides in depth information about the requested command or allows users to search for commands related to a particular keyword.
Syntax
Shows you online manuals on Unix commands.
man [-] [-k keywords] topic
- Displays the manual without stopping.
-k keywords Searches for keywords in all of the manuals available.
topic Displays the manual for the topic or command typed in.
Examples
man mkdir
Lists help information on the mkdir command.
man -k irc


Printenv:printenv - print all or part of environment
SYNOPSIS printenv [ VARIABLE ]...
printenv OPTION
DESCRIPTION
If no environment VARIABLE specified, print them all.
--help
display this help and exit
--version
output version information and exit

Sleep:sleep - delay for a specified amount of time
SYNOPSIS sleep NUMBER [ SUFFIX ]...
sleep OPTION
DESCRIPTION
Pause for NUMBER seconds. SUFFIX may be `s' for seconds (the default), `m' for minutes, `h' for hours or `d' for days. Unlike most implementations that require NUMBER be an integer, here NUMBER may be an arbitrary floating point number.


This is exercise two

Your objective in this activity is to locate a file called Texas.txt. It is located in a subdirectory of: /home. This exercise is designed to give you experience in navigating the Unix/Linux directory structure.
Once you find the file Texas.txt, read it by typing:

more Texas.txt

In your lab report, include your favorite line from the Texas.txt file and the full path name of the directory where the file is located.

Explanation / Answer

First of all this is not related to java ,these are the set of unix commands.
in first exercise i couldn't find any question just notes about set of unix command.

So , Exercise two :

to find the file texas.txt ( using find command )

find . -name "texas.txt"

here 'find' is the command name and '.' represent current directory ( the directory in which you are working ,the directory in which you are in ).in question it is /home
Then comes the flag '-name' ,it means we are searching the files by there name .
Then comes the name of the file.

its output will be of type (if file is found).

/home/<another directory >...../texas.txt

then use the more command like this :

more -n /home/<another directory >...../texas.txt
here -n is the number of lines you want on your screen ,to see the remaining line you have to scroll.

strict note : please use any integer in place of n ,other it will show error.if -n ( like -10) is not given it will default print 40 lines.


* if all can be put into one command ,use ( No need BTWfor this exercise ,just for knowledge).

find . -name "texas.txt" | xargs more -n

* there is another command called locate to find the file.( it will locate all the files in your computer which contain the subtring texas.txt

use locate as :

locate texas.txt

in your lab report write your favourite line by reading the file with 'more' command,and the write the output of find command as your full path of file .