码迷,mamicode.com
首页 > 系统相关 > 详细

Linux Programming

时间:2018-03-15 16:33:16      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:load   environ   AMM   list   some   def   turn   bsp   text   

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

标签:load   environ   AMM   list   some   def   turn   bsp   text   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!