The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
Google UNIX.COM


UNIX Desktop for Dummies Questions & Answers Questions regarding GNOME, KDE, CDE, Open Office, etc go here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running UNIX commands remotely in Windows box from Unix box – avoid entering password D.kalpana UNIX for Dummies Questions & Answers 1 04-20-2007 02:24 AM
How to use unix commands in awk jerome Sukumar Shell Programming and Scripting 7 12-26-2006 04:15 AM
SQL Commands in Unix sish78 Shell Programming and Scripting 6 05-25-2006 03:30 PM
Maingrame to UNIX sending UNIX commands skammer UNIX for Dummies Questions & Answers 2 06-27-2002 09:19 AM
Unix Commands smdakram UNIX for Dummies Questions & Answers 2 01-13-2002 04:12 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-06-2003
Registered User
 

Join Date: Dec 2003
Posts: 1
Unix commands

What is the unix command that will display the current UTC time, hours, and minutes only.


What is the unix command for sorting in descending order.

What is the unix command for display the first 10 characters in a file.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 12-06-2003
Moderator
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,422
1. Try

date -u '+%H:%M'

2. This depends on what you are sorting

3. Try

head -c 10 myfile


Please read the man pages for details.
Reply With Quote
  #3 (permalink)  
Old 12-07-2003
google's Avatar
Moderator
 

Join Date: Jul 2002
Location: Atlanta
Posts: 740
Re: Unix commands

Quote:
Originally posted by charlton
What is the unix command for display the first 10 characters in a file.
As cbkihong posted, head -c 10 myfile will get you the first 10 chars of a file. However, if you use head and/or tail, you can get the first 10 chars of a particular line in a file.

Example

head -c 10 myfile | head -1 #cuts the first 10 chars from the first line
Reply With Quote
  #4 (permalink)  
Old 12-08-2003
Kelam_Magnus's Avatar
Unix does a body good.
 

Join Date: Aug 2001
Location: DFW McKinney, TX,
Posts: 1,069
Charlton,

many of hte answers you seek can be found in teh man pages on any UNIX system...

IF you read the sort man page, you will see that it shows. you the options for sorting...


Here is an excerpt from the man page... the -r option reverses the sort order... -k n where n is a number sorts based upon the field number, normal delimiter is space or tab.



Sort the contents of infile with the second field as the sort key:

sort -k 2,2 infile

Sort, in reverse order, the contents of infile1 and infile2, placing
the output in outfile and using the first two characters of the second
field as the sort key:

sort -r -o outfile -k 2.1,2.2 infile1 infile2

Sort, in reverse order, the contents of infile1 and infile2, using the
first non-blank character of the fourth field as the sort key:

sort -r -k 4.1b,4.1b infile1 infile2
__________________
My brain is your brain
Reply With Quote
  #5 (permalink)  
Old 09-29-2005
Registered User
 

Join Date: Sep 2005
Posts: 1
Red face Telnet

Where can I get info on how to use telnet?
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0