首页 > 系统服务 > 详细

Linux Programming

时间:2018-03-15 15:56:31      阅读:211      评论:0      收藏:0      [点我收藏+]

You can use the cat command to see the content of a file and display the line numbers by using the -b option along with the cat command as follows

cat -b filename

You can use the wc command to get a count of the total number of lines, words, and characters contained in a file. 

wc filename

To make a copy of a file use the cp command.

cp source_file destination_file

To go in your last directory

cd -

To list the files in a directory

ls dirname

An important Unix concept is the environment, which is defined by environment variables. Some are set by the system, others by you, yet others by the shell, or any program that loads another program.

A variable is a character string to which we assign a value. The value assigned could be a number, text, filename, device, or any other type of data. For example, first we set a variable TEST and then we access its value using the echo command 

TEST="Unix Programming"
echo $TEST

  It produces the following result.

Unix Programming

  If we don‘t use the $ sign, it returns

TEST

  Really clear a terminal instead of simply shifting previous output upwards when you run "clear" command.

tput reset

  

Linux Programming

原文:https://www.cnblogs.com/cxxszz/p/8573773.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!