Unix Commands
cd ~ - takes you to your home directory. Welcome to my page
a file using two greater-than signs (>>).
Welcome to my page
Notes
- The root directory (/) contains all of the folders and files on your computer.
Set your goals high, and don't stop till you get there!!!
cd ~ - takes you to your home directory.
Notes
Opening and Exiting vi
1) Which expression represents 5 more than the product of 2 and y ?
Solution
Product of 2 and y is 2*y or 2y
5 more than the product of 2y is 2y + 5 or 5 + 2y
---------------------------------------------------------------------------------------
2) Which value of b makes the inequality 3b > 12 true?
a) 2 b)3 c)4 d)5
Solution
Lets assume b=2
Replace b by 2 in 3b > 12
3*2 > 12
6 > 12 ( which is not true because 6 < 12)
Lets assume b=3
Replace b by 3 in 3b > 12
3*3 > 12
9 > 12 ( which is not true because 9 < 12)
Lets assume b=4
Replace b by 4 in 3b > 12
3*4 > 12
12 > 12 ( which is not true because 12 = 12)
Lets assume b=5
Replace b by 5 in 3b > 12
3*5 > 12
15 > 12 (yes, 15 is greater than 12 which is true)
Answer is d) 5
Create Hard links:
Command:
The below command created hardlink called file1.txt for the existing file trial1.txt in /home/student
ln file1.txt /home/student/trial1.txt
Create Soft link:
Command:
The below command created soft link called file1.txt for the existing file trial1.txt in /home/student
ln -s file1.txt /home/student/trial1.txt
Column 1 : indicates information regarding file permission.
Column 2 : indicates the number of links to the file.
Column 3 & 4 : indicates the owner and group information.
Column 5 : indicates the file size in bytes.
Column 6 : shows the date and time on which the file was recently modified.
Column 7 : shows the file or directory name.
ls ~
ls ~ command shows the contents of the home directory
ls -g
If we don't want to display the owner information in your list, then we can exclude this column with the help of this command.
ls -lrt
The ls command is used for listing the contents of a directory. The lrt part is a combination of three different options:
ls -n
It is used to print group ID and owner ID instead of their names.
ls -li
This command prints the index number if file is in the first column.
ls -p
It is used to identify the directory easily by marking the directories with a slash (/) line sign.
ls --version
It checks the version of ls command.