Saturday, April 26, 2014

tail

  •   tail command example
Print the last 10 lines of a file by default.


$ tail filename.txt
Print N number of lines from the file named filename.txt
$ tail -n N filename.txt
View the content of the file in real time using tail -f. This is useful to view the log files, that keeps growing. The command can be terminated using CTRL-C.
$ tail -f log-file
 
 
 

Related Posts:

  • cp cp command examples   Copy file1 to file2 preserving the mode, ownership and timestamp. $ cp -p file1 file2 Copy file1 to file2. if file2 exists prompt for confirmation before overwritting it. … Read More
  • chmod chmod command examples chmod command is used to change the permissions for a file or directory. Give full access to user and group (i.e read, write and execute ) on a specific file. $ chmod u… Read More
  • crontab crontab command example View crontab entry for a specific user  # crontab -u linuxcare -l Schedule a cron job every 10 minutes. */10 * * * * /home/linuxcare/check-disk-space More crontab ex… Read More
  • diff diff command examples Ignore white space while comparing. # diff -w name_list.txt name_list_new.txt  2c2,3 < John Doe --- > John M Doe > Jason Bourne Normal 0 false… Read More
  • chown chown command examples chown command is used to change the owner and group of a file. To change owner to oracle and group to db on a file. i.e Change both owner and group at the same… Read More

0 comments:

Post a Comment