Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-07-2012, 01:23 PM   #1
LQ Newbie
Registered: Feb 2012
Posts: 4

Rep: Reputation: Disabled
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)
Old 02-07-2012, 01:46 PM   #2
Senior Member
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
# 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
Old 02-07-2012, 01:47 PM   #3
LQ Addict
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

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

Last edited by EDDY1; 02-07-2012 at 01:49 PM.
Old 02-07-2012, 02:50 PM   #4
Satyaveer Arya
Senior Member
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
What have you tried so far?
Old 02-07-2012, 02:56 PM   #5
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
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.
Old 02-07-2012, 03:01 PM   #6
Registered: Sep 2011
Distribution: fedora, redhat, mint
Posts: 87

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

# vi filename.extention


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
dos2unix command in shell scripting pdiv Linux - Server 3 07-05-2011 02:06 PM
shell scripting need to translate a command output megerdin Programming 5 10-19-2009 09:30 AM
Shell Scripting Problem: command not found gods_design Programming 3 02-10-2009 11:58 PM
shell scripting/ the fc -l command ! mayaabboud Linux - Newbie 12 01-03-2008 06:38 PM
shell scripting problem, sed command kamkos Linux - General 5 03-31-2007 09:39 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:59 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration