Sponsored Content
Homework and Emergencies Homework & Coursework Questions Using ls or echo to display a specific output Post 302608136 by methyl on Friday 16th of March 2012 09:33:35 AM
Old 03-16-2012
Reference the sample directory listing in post #1 section 1.

Interestingly all the directories have the same inode number (the first field) but you would only find the first directory with a find /filesystem -xdev -inum 8140 command because "find" ignores the ".." directory.
The links count is 9 when you would expect it to be 6, therefore there are 3 more directories with this inum somewhere.
We can forget using the inode number.

The sample directory listing is not in alphabetic order. There is no single "ls" command which could produce this output ... unless perhaps there is a hidden timestamp and the "-t" parameter was used or you have a version of "ls" where you can turn off the sort.

The sample includes the path name in the file field. You can only get this from "ls" if you specified the path on the "ls" command line.

Therefore I think that the sample came from 6 individual "ls" commands.

For example:
Code:
ls -liadp sample/text/\.\.

    8140 drwxr-xr-x 9 root bin 18 Jan 20 2009  sample/text/../

Note: I don't have the same version of "ls" as you. If you haven't got "-p", then "-F" is just as good. I haven't got "-h" (human readable) at all.

Last edited by methyl; 03-16-2012 at 10:42 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Display from a variable using echo.

I have a variable that is outputting a lot of space. here has been 45 lines returned ... how can I remove the spaces between the "been and the 45" CODE: fil_len=`wc -l < coshb.txt` if ; then cat coshb.txt | more echo " " echo "There has been ${fil_len} lines... (4 Replies)
Discussion started by: jagannatha
4 Replies

2. Shell Programming and Scripting

what does echo $$ command display

whats the value stored in $$ (2 Replies)
Discussion started by: suri
2 Replies

3. UNIX for Dummies Questions & Answers

how to display specific lines of a specific file

are there any basic commands that can display lines 99 - 101 of the /etc/passwd file? I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies

4. Shell Programming and Scripting

Display echo results in three column

Dear Friends, I have my command output which displays on one row and values are now scrollable (vertical) 3 pages. How do i display those output in three column so that i no need to scroll? Example: dcadd$cat components 1.Caluculator 2.Diary ... ... 50.Mobile 51.Battery .. ...... (12 Replies)
Discussion started by: baluchen
12 Replies

5. Shell Programming and Scripting

echo display problem

Hi I am facing a strange problem a=03 echo ${a} the output is 3 But i want to display it is 03 Can you people help me how to display it like 03. Thanks (2 Replies)
Discussion started by: aishsimplesweet
2 Replies

6. Shell Programming and Scripting

Help with ksh script to display output with specific contents

This is Input - starts with Storage Group Name and ends with Shareable and the loop continues all I need is Storage group name and Alu numbers in the below output format requested. Storage Group Name: abcd Storage Group UID: 00:00:000:00:0:0:0 HBA/SP Pairs: HBA UID ... (6 Replies)
Discussion started by: maddysa
6 Replies

7. UNIX and Linux Applications

display which line returns specific output

Hi, I'm trying to figure out a way to find which line in my file.txt with IP addresses: 192.168.0.1 192.178.0.2 etc... returns specific result when I execute command affecting all lines. For example when I run: for line in `cat file.txt`; do snmpget $line done it displays the... (5 Replies)
Discussion started by: svetoslav_sj
5 Replies

8. Shell Programming and Scripting

display echo only once

lets say I am printing something out echo "Please enter a valid username" and its being printed out 5 times, is there any way I can limit to only being displayed ONCE. I tried echo -n but that just makes everything fit on one line. Right now it keeps saying Please enter a valid... (5 Replies)
Discussion started by: subway69
5 Replies

9. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

10. Shell Programming and Scripting

How do we display specific row of an output from bottom given line number?

I pass a number to my script. Passing "1" below. ./getfile.sh 1 echo "User entered: $1" ls -ltr *.conf | sed -n '$p' I wish to use ls -ltr i.e list files in ascending order of time the latest showing at the bottom of the output. Number 1 should get me the last row of ls -ltr output i.e... (9 Replies)
Discussion started by: mohtashims
9 Replies
OPARCHIVE(1)						      General Commands Manual						      OPARCHIVE(1)

NAME
oparchive - produce archive of oprofile data for offline analysis SYNOPSIS
oparchive [ options ] [profile specification] -o [directory] DESCRIPTION
oparchive generates a directory populated with executable, debug, and oprofile sample files. This directory can be move to another machine via tar and analyzed without further use of the data collection machine. See oprofile(1) for how to write profile specifications. OPTIONS
--help / -? / --usage Show help message. --version / -v Show version. --verbose / -V [options] Give verbose debugging output. --session-dir=dir_path Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile). --image-path / -p [paths] Comma-separated list of additional paths to search for binaries. This is needed to find modules in kernels 2.6 and upwards. --root / -R [path] A path to a filesystem to search for additional binaries. --output-directory / -o [directory] Output to the given directory. There is no default. This must be specified. --exclude-dependent / -x Do not include application-specific images for libraries, kernel modules and the kernel. This option only makes sense if the profile session used --separate. --list-files / -l Only list the files that would be archived, don't copy them. ENVIRONMENT
No special environment variables are recognised by oparchive. FILES
/var/lib/oprofile/samples/ The location of the generated sample files. VERSION
This man page is current for oprofile-0.9.6. SEE ALSO
/usr/share/doc/oprofile/, oprofile(1) 4th Berkeley Distribution Tue 06 July 2010 OPARCHIVE(1)
All times are GMT -4. The time now is 02:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy