General :: Command Line - Count Number Of Folders In A Drive Using System?

Apr 9, 2010

I need to organise an external HDD such that there is no more than 500 folders on it.

Ubuntu's "Properties" pane shows only the file count, not the folder count.

Is there a simple CLI line that will tell me the number of subdirectories?

View 3 Replies


ADVERTISEMENT

Programming :: Count The Number Of Slashes In Each Line?

Jan 18, 2010

I have a file with lines that look like this:

Dev/7_Texas2004/4_Caves/page.htm
Dev/7_Texas2004/5_SanMarcos/page.htm
Dev/7_Texas2004/6_Austin/page.htm

And I'm trying to count the number of slashes in each line. I figured (with my limited knowledge of bash) that the best thing to use would be sed. So I ran this to print "not /": sed '!s////g' file # and eventually adding " | wc -m" to it. and I got the same result as if I ran cat, no modification at all:

[Code]...

View 7 Replies View Related

General :: Grep Command - Show The Files But Not The Line Count

Oct 31, 2010

This has to also show the line count. I can get it to show the files but not the line count. What is the single command used to identify only the matching count of all lines within files under the /etc directory that contain the word „HOST? List only the files with matches and suppress any error messages.

View 4 Replies View Related

General :: Identify File Types - Command Line Arguments - And Count - How Many Of Them Are Regular Files

Feb 20, 2010

Write a script that will take a list of filenames as arguments and output a count of how many of them are regular files, and how many of them are scripts (if the file is executable, it will be assumed to be a script file)

Counts always come back as 0

View 5 Replies View Related

Software :: Audit Tool In System To Count Number Of Times It Run?

Dec 30, 2009

I'm the POC for all my families Linux computers. Is it possible to get statistics on which programs are accessed, how frequently, for how long and by which user?

When it comes time to upgrade it would be useful so I know which programs to concentrate my testing. I usually just e-mail and ask but every time people forget to send me the programs they actually use.

View 2 Replies View Related

Programming :: Count Number Of CD-ROMs On A System Using Shell Script

Apr 7, 2010

I am trying to get the count of number of CD-ROMs attached with my Linux system using a bash shell script. I have decided to use the following method for it:

Code:
debian:~# cat /proc/sys/dev/cdrom/info | grep "drive name:"
drive name: sr0 hdb

So basically I know that there are two CD-ROMs attached to the system. Now there can be three also like this:

Code:
debian:~# cat /proc/sys/dev/cdrom/info | grep "drive name:"
drive name: sr0 sr1 hdb

All I want to do is in my shell script to get the count of the devices in a variable using the above command.

View 2 Replies View Related

General :: Sed - Csv Averages On Command Line - Take The Average Of All Rows With The Same 1st Number(key)

Jul 20, 2010

I have a big file full of records like this

1, 2, 4, 5, 6
1, 3, 5, 6, 3
1, 4, 5, 6, 6
2, 4, 5, 5, 5
2, 3, 4, 5, 2

anyway i need to take the average of all rows with the same 1st number(key). i.e.

1, 3, 4.66, 5.66, 5
2, 3.5, 4.5, 5, 3.5

I know this is something awk/sed would be great for, i just dont have enough experience with them to accomplish it, Also, what about averaging those columns together? so, after I output this to a file, id like to get another like:

1, 4.58
1, 4.125

The number of colums to add might not always be 4 either. EDIT: this might be easier to do in gnuplot, so I mainly just need an answer to the first part.

View 3 Replies View Related

General :: Find Out The Serial Number Of Hard Disk Through Command Line On OpenSuse 11.2 ?

Jul 12, 2010

I read this thread but

Code:
anisha@linux-uitj:~> su
Password:

[code]...

View 14 Replies View Related

OpenSUSE :: Count Lines In Multiple Text Files From Command Line?

Apr 27, 2010

I want to (from the command line) be able to counte lines in a bunch of files of a specific type in a folder and all its sub-folders. How would I do this?

View 1 Replies View Related

General :: Script To Count # Of Chars Per Line - If Line Meets Certain Criteria - And Get Avg #?

Sep 11, 2009

I have several files with many lines something like this:

I'm trying to write a script that will count the number of characters per line that doesn't contain a ">" symbol and give me an average of those values. I have most of the script together but I can't figure out how to connect some of the steps.

Code:

View 3 Replies View Related

General :: Count How Many Number Occurrences In Series?

Jun 2, 2011

i try to make a script in bash that u choose a number for example 501 and another number like 1 and find how much the 1 number repeat in all numbers from 1 to 501 for example 11 -->1 repeat 2 times.in 1 to 501 the number 1 repeat 200 times.

View 4 Replies View Related

General :: Count The Number Of Lines In All Files In This Directory?

Jul 5, 2011

I want to count the lines of all files in this directory and all its subdirectories, but exclude directories "public", "modules", and "templates".

View 2 Replies View Related

General :: Count The Right VGA Parameter Number For Grub To Use Another Resolution?

Dec 13, 2010

I am using grub of version 2, and current resolution vga=795 (probably). X runs at 1680x1050. So what I would like to know is, how can I count the right VGA parameter number for grub, to use another resolution?

View 11 Replies View Related

General :: Trying To Display Count Of Number Of Subdirectories In Directory

Feb 7, 2011

I am a noob and I am trying to display a count of the number of subdirectories in a directory. I have been able to use find -type d to list directories and subdirs but I want a numerical value of dirs and subdirs. I know ls -l gives a count but when I try ls -l -d all it shows is "." I also have tried a combination with the -R option but nothing seems to be working for me.Please forgive my ignorance but I am working on a script for class and this is the first step.

View 3 Replies View Related

General :: Count Total Number Of Lines Of Found Files?

Mar 20, 2011

I'm running a find. -name pattern to find some files, and I'd like to elegantly get the total number of lines in these files. How can I achieve that?

View 4 Replies View Related

General :: Count The Number Of Lines Inside A File And Put The Output Into A Variable?

Feb 1, 2011

i need to count the number of files and put the output into a variable. i used wc -l filename but i couldnt find an option to put the output to variable. example if the number o line is 5, i need the output of echo $x is 5.

View 3 Replies View Related

General :: Write Shell Script Which Can Take Number Of Files And Count Total Rows From All CSVs?

Oct 8, 2010

I need to write shell script which can take number of files and count total rows from all CSVs and display total number of rows counted in all files. Is there any possibility of doing that using shell script and if yes then how.

View 4 Replies View Related

General :: Command-line Distor Off USB Flash Drive?

Jan 19, 2011

I have a 32GB flash drive that I want to:- Have an installation o with no X-terminal. Only command-line.- Be bootable by plugging into any computer and turning that computer on.My wishes are strictly for writing purposes. I want to write in a minimal environment where there's no distraction by other programs or Internet. I don't care what programs exist on the linux distro as long as it has a text-editor.Please tell me how to proceed. What linux distro I should get. How to install it on a USB stick. Anything I need to know.

View 11 Replies View Related

General :: Mount Usb Drive In Command Line IN UBUNTU?

Mar 15, 2010

want to copy a file from my desktop to usb drive in command line...how can i do it...i have no gui interface..all i want to do it by command line.i.e how to mount the usb drive and copy the file to usb and then unmount it..i also want to access windows xp drive from linux in command line without gui interface...in opensuse there is windows folder under file system but in ubuntu there is no such option...so if i want to place a file from linux to windows drive such as d ..how can i manage it with command line...no gui interface is available...

View 1 Replies View Related

General :: Getting The Line Of String From Previous Pipe Output By Line Number?

Feb 8, 2010

After running the following command, I get:

[root@yukiko /]# find / -iname .bashrc
/home/clamav/.bashrc
/home/vpopmail/.bashrc
/etc/skel/.bashrc
/root/.bashrc

But I would like to have a command that prints a specific line by supplying the command with the line number, for example:

[root@yukiko /]# find / -iname .bashrc | getline(2)
/home/vpopmail/.bashrc

Is there such a command on CentOS?

View 3 Replies View Related

General :: Sort By Line Size (number Of Characters In A Line)?

Jan 8, 2010

I want to sort a number of lines based on their size:

data:
-------
12345678
87654321
1234

[code]....

Should output as:
-----------------
1
2
12
21

[code]....

But i'm gettings this with sort
----------------
1
12
123
1234

[code]....

Can we sort the above "data" text, based on "number of characters" instead of "character order"?

View 8 Replies View Related

General :: Moving A File To The Root Of The Drive Via Command Line

Oct 17, 2010

How can I move a directory to the root of a drive via command line?

In MS-DOS it would be 'move C:/GAMES/QUAKE C:/'

What is the equivilent in Linux?

View 8 Replies View Related

General :: Osx - How Does Mac's Command Line Compare To System

Aug 23, 2010

I love Ubuntu Linux - especially the commmand line. But I have to admit that, at least for now, Windows is more user-friendly - there's more software for it, more drivers, and more stuff just works.

Knowing that Mac is built on Unix makes me wonder if it's the sweet spot between them. But I wonder: how similar is the Mac command line to Linux's bash? Could I pick right up with using vim and bash scripting and git, etc? Would common commands like changing directories be different? Does anybody know an online "compare and contrast" resource?

View 5 Replies View Related

General :: Command Line - Dterm For System?

Nov 26, 2010

Is there a something similar to DTerm available for Linux?

View 2 Replies View Related

General :: How To Delete A Line At Specific Line Number

Jun 15, 2010

I m writing a script to delete a line at particular location.

But i m unable to use variable for specifying line number.

For example.

Code:

works fine and deletes 7th line from my file

But

Code:

gives following error.

Code:

View 7 Replies View Related

General :: Showing The Line Count Of A Specific File

Mar 30, 2011

Is this the correct way to show the line count of a specific file?

cat file | grep * -c

View 3 Replies View Related

General :: How System Know It's Collection Of Command Line Programs

Aug 23, 2010

I just started using ubuntu after being a long time windows user.

what i find really interesting is that in command line, i can type many programs and commands, eg firefox can be run via command line from anywhere. In windows cmd prompt, im used to having to run the .exe file by first navigating to it, then being able to run the .exe.

what i wanna know is how does linux know all the programs at the command line?

View 5 Replies View Related

General :: Splitting Text File Into Several Parts By Line Count

Sep 21, 2009

I have a utility that works with files. The utility is crashing at after about 120 files. The input to the utility is a file containing a filelist. I want to cut the file with the file names in it to seperate files containing about one hundred or so. My thought was to determine the number of lines/100 and then use head and delete to create temporary files to run the utility multiple times to prevent the crash. When I tried to create a variable using the wc -l command the output gives me the number of total lines but it also includes the filename of the input file. (873 Filename.txt) I can not figure out how to remove the Filename.txt from the variable.

View 2 Replies View Related

General :: Get Command Line System OS Using Sandbox For Learning Its Prompt?

Nov 27, 2010

Possible Duplicate:
Version of Linux with a command prompt?

Which software of Linux to use for command line running? Since I am using MySQL to run from Linux and want to run Linux, which software to download in Linux? There are multiple ones. Can I run .sh scripts and learn how to operate on Linux using the command line? Also use MySQL as backend on Linux?

View 1 Replies View Related

General :: Change Brightness On System Desktop Through Command Line?

Mar 9, 2011

I have a Debian Linux desktop. I want to change the screen's brightness without pressing the brightness button of my monitor. How can I do this? is this possible in command line or is there an application to be installed?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved