LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-07-2012, 02:23 PM   #1
saqib.ganatra
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, 02:46 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

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

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Homework
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 02:49 PM.
 
Old 02-07-2012, 03: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, 03:56 PM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
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, 04:01 PM   #6
clocker
Member
 
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
 
  


Reply


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 03:06 PM
shell scripting need to translate a command output megerdin Programming 5 10-19-2009 10:30 AM
Shell Scripting Problem: command not found gods_design Programming 3 02-11-2009 12:58 AM
shell scripting/ the fc -l command ! mayaabboud Linux - Newbie 12 01-03-2008 07:38 PM
shell scripting problem, sed command kamkos Linux - General 5 03-31-2007 10:39 PM


All times are GMT -5. The time now is 12:52 AM.

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