LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux command and shell scripting (https://www.linuxquestions.org/questions/linux-newbie-8/linux-command-and-shell-scripting-928148/)

saqib.ganatra 02-07-2012 01:23 PM

Linux command and shell scripting
 
Write a script that show the information of file, scripts contain the following values.
1)Information placed in file.
2)File size
3)Encoding(file format)

jhwilliams 02-07-2012 01:46 PM

Code:

# cat writes out the contents of the file.
cat file.txt

# du shows the "disk usage" (that is, the size.)
du file.txt

# The file command shows the file type.
file file.txt


EDDY1 02-07-2012 01:47 PM

Homework
Btw that doesn't mean they don't deserve help, but they do need to tell what they have tried the outcome.

Satyaveer Arya 02-07-2012 02:50 PM

What have you tried so far?

colucix 02-07-2012 02:56 PM

Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

clocker 02-07-2012 03:01 PM

Use a text editor to view file contents, like vi, gedit, emacs and many others e.g

# vi filename.extention


All times are GMT -5. The time now is 08:07 PM.