当前位置: 技术问答>linux和unix
小弟刚接触LINUX,遇到了问题无法解决,请大家帮忙!
来源: 互联网 发布时间:2015-11-30
本文导语: 请回答以下问题: 1. Create an alias called y that executes the ls command. 2. Set a shell variable named NAME equal to the name “Foo”. How do you see the contents of that variable? 3. Concatenate file1 and file2 and print the last 10...
请回答以下问题:
1. Create an alias called y that executes the ls command.
2. Set a shell variable named NAME equal to the name “Foo”. How do you see the contents of that variable?
3. Concatenate file1 and file2 and print the last 10 lines on the standard output.
4. Remove the directory which name is “Bar”, without any prompt before removal. The directory is not empty now.
5. How can you modify the permissions on the file “Foo”, so that your partner(in the same group) can read the file ?
6. Display the files which names are start with an “f” and end with an “o”?
7. Display the files which names are start with “Foo” and end with three digits?
8. Delete a user which name is “Foo” and his HOME directory must be removed at the same time.
9. Find the file larger than 10k in the current directory.
10. Print the first 35 lines of file “Foo” on the screen.
11. Summarize disk usage of each FILE, recursively for directories:
12. Assume a file contains more than 200 lines, display the lines from 100 to 150:
13. List only sub-directory names (not include file names) in current directory:
14. Redirect standard error to standard out :
15. Translate, squeeze, and/or delete characters from standard input, writting to standard output:
16. Switch user id to username:
17. Create empty file or update timestamp on existing file:
18. Remove directories in interactive model:
19. Extract files from an archive test.tar.gz:
1. Create an alias called y that executes the ls command.
2. Set a shell variable named NAME equal to the name “Foo”. How do you see the contents of that variable?
3. Concatenate file1 and file2 and print the last 10 lines on the standard output.
4. Remove the directory which name is “Bar”, without any prompt before removal. The directory is not empty now.
5. How can you modify the permissions on the file “Foo”, so that your partner(in the same group) can read the file ?
6. Display the files which names are start with an “f” and end with an “o”?
7. Display the files which names are start with “Foo” and end with three digits?
8. Delete a user which name is “Foo” and his HOME directory must be removed at the same time.
9. Find the file larger than 10k in the current directory.
10. Print the first 35 lines of file “Foo” on the screen.
11. Summarize disk usage of each FILE, recursively for directories:
12. Assume a file contains more than 200 lines, display the lines from 100 to 150:
13. List only sub-directory names (not include file names) in current directory:
14. Redirect standard error to standard out :
15. Translate, squeeze, and/or delete characters from standard input, writting to standard output:
16. Switch user id to username:
17. Create empty file or update timestamp on existing file:
18. Remove directories in interactive model:
19. Extract files from an archive test.tar.gz:
|
9.date +%X
|
1. Create an alias called y that executes the ls command.
alias y ls
2. Set a shell variable named NAME equal to the name “Foo”. How do you see the contents of that variable?
setenv NAME = "FOO" (csh)
3. Concatenate file1 and file2 and print the last 10 lines on the standard output.
4. Remove the directory which name is “Bar”, without any prompt before removal. The directory is not empty now.
rm -rf Bar
5. How can you modify the permissions on the file “Foo”, so that your partner(in the same group) can read the file ?
chmod
6. Display the files which names are start with an “f” and end with an “o”?
正则表达式+grep
7. Display the files which names are start with “Foo” and end with three digits?
正则表达式+grep
8. Delete a user which name is “Foo” and his HOME directory must be removed at the same time.
man userdel
9. Find the file larger than 10k in the current directory.
10. Print the first 35 lines of file “Foo” on the screen.
11. Summarize disk usage of each FILE, recursively for directories:
12. Assume a file contains more than 200 lines, display the lines from 100 to 150:
13. List only sub-directory names (not include file names) in current directory:
14. Redirect standard error to standard out :
15. Translate, squeeze, and/or delete characters from standard input, writting to standard output:
|
16. Switch user id to username:
su user
17. Create empty file or update timestamp on existing file:
touch file
18. Remove directories in interactive model:
rm -rf
19. Extract files from an archive test.tar.gz:
tar xvfz test.tar.gz
alias y ls
2. Set a shell variable named NAME equal to the name “Foo”. How do you see the contents of that variable?
setenv NAME = "FOO" (csh)
3. Concatenate file1 and file2 and print the last 10 lines on the standard output.
4. Remove the directory which name is “Bar”, without any prompt before removal. The directory is not empty now.
rm -rf Bar
5. How can you modify the permissions on the file “Foo”, so that your partner(in the same group) can read the file ?
chmod
6. Display the files which names are start with an “f” and end with an “o”?
正则表达式+grep
7. Display the files which names are start with “Foo” and end with three digits?
正则表达式+grep
8. Delete a user which name is “Foo” and his HOME directory must be removed at the same time.
man userdel
9. Find the file larger than 10k in the current directory.
10. Print the first 35 lines of file “Foo” on the screen.
11. Summarize disk usage of each FILE, recursively for directories:
12. Assume a file contains more than 200 lines, display the lines from 100 to 150:
13. List only sub-directory names (not include file names) in current directory:
14. Redirect standard error to standard out :
15. Translate, squeeze, and/or delete characters from standard input, writting to standard output:
|
16. Switch user id to username:
su user
17. Create empty file or update timestamp on existing file:
touch file
18. Remove directories in interactive model:
rm -rf
19. Extract files from an archive test.tar.gz:
tar xvfz test.tar.gz
|
12. Assume a file contains more than 200 lines, display the lines from 100 to 150:
tail filename -n 100 150
tail filename -n 100 150