General :: Ls Command And Displaying Number Of Files In Current Directory?
Oct 15, 2010
What command will provide you with the number of files in your current directory?
Choose one answer.
A. ls -c
B. ls | wc -w (this one)
C. ls -n | count
D. ls -wc (this one ?)
View 5 Replies
ADVERTISEMENT
Aug 24, 2010
Code:
$ echo 2 * 3 > 5 is a valid inequality. This will create a file in the current directory named '5' with the number '2' in it, the names of all the files in the current directory, followed by the number '3' and 'is a valid inequality.'
What I do not understand is why 'is a valid inequality' gets written to this file. I thought it would write '2', all the file names in the current directory, then '3' into the file called '5'. Why does the 'is a valid inequality.' get written to the file also?
View 3 Replies
View Related
Feb 21, 2011
Is there an easy way to put all of the current directory's files on the command line, without tab-completing each individual one?
View 9 Replies
View Related
Apr 28, 2011
Does anyone know how to stop the du command from displaying the directory name?
View 1 Replies
View Related
Jul 4, 2011
I'm trying to setup an alias, that when I change to another directory, any directory, it will also display all its contents like ls -al:Well, that doesn't work. I guess it's an issue with the use of wild-cards.Maybe I should define a new, so far unused, name for the alias like cdl for example.Would be great if someone could help me. I search in several examples for bash aliases but couldn't find the right solution.
View 9 Replies
View Related
May 10, 2011
I'm constantly going 'cd ../../../../'. Is there a command/alias that could let me go 'cmd 4' and I'd be taken back 4 directories?
View 8 Replies
View Related
Mar 31, 2011
I have been playing around with the tar command and I know this is how to use it.
Code:
tar -cf [filename] [directory]
But what I want to make an archive from the current directory I thought just to not enter a directory but that doesn't work. I get an error about creating a empty archive so how to do I make it so how do I tell it to do the current directory?
View 5 Replies
View Related
Feb 22, 2010
i need to know how to find number of files in a directory? is there any system calls in fedora 12.And i need to know how to perform a operation if the that count increases by one?
View 14 Replies
View Related
Apr 30, 2010
I am total new to linux as I worked mostly on RTOS (symbian). My problem is, I need to find the file IOSTREAM.H and I am following commands below:
1) cd /
2) find . iostream.h ( finds the file / directory from the current path)
It shows No such File or Directory
View 7 Replies
View Related
Feb 10, 2010
I've a directory containing around 2.8 lacs of files. I want to move them to another directory.If I use cp or mv then I get an error 'argument list too long'. If I write a script like
for file in ls *; do
cp {source} to {destination}
done
then because of ls command , its performance degrades.How can I do this?
View 7 Replies
View Related
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
Oct 5, 2010
Assumed y directory structure looks as follow:
Code:
--root
-- dir1
-- dir1-1
-- dir2
-- dir2-1
-- dir2-2
And under each sub dir there are some log files ended with .log. Now I want to list all these log files. How to to that?
View 2 Replies
View Related
Oct 5, 2010
Assumed y directory structure looks as follow:
Code:
--root
-- dir1
-- dir1-1
[code]....
And under each sub dir there are some log files ended with .log. Now I know how to list all these log files with:
Code:
find . -type f -name "*.log"
Assumed now there is a string called "Hello World" inside some of these files. How can I find out these files? I try followings but failed
Code:
grep "This is" | find . -mtime 0 -type f -name "*.log"
View 4 Replies
View Related
Apr 7, 2011
I have the following problem:
CASE_FOLDER
----------->0_FOLDER
-------------------->ForceX ForceY ForceZ
[code]...
View 1 Replies
View Related
Jul 13, 2011
I'm quite new to linux but I have configured a simple ftp server and it's working great. I have a FTP-Shared folder with upload and download subfolders. Under upload's and download's I have identical category subfolders like mp3's, movies, software etc. in both. As the guy's upload, I would like to create a line crontab where I can move all the content under /FTP-Shared/upload/mp3/* older than 14 day's to FTP-Shared/downloads/mp3/ recursively (Like in cp command), but the timestamp must be searched on the first directory and not sub files example: /mp3/Club Dance/CD1/Hallo world.mp3This is how far I got:[root@clients ~]# /usr/bin/find /FTP_Shared/upload/Mp3s/ -depth -mindepth 1 -mtime +14 -type d -exec mv -f {} /FTP_Shared/download/Mp3s/ ;This command moves the directory and files, but it is not recursively
View 4 Replies
View Related
Jun 16, 2011
I am using the diff command with the -r option, to compare a large number of files and files in subdirectories. My main interest is to find out which files have been changed, and not what the actual changes are, and since a lot of files has been changed, it would be a lot easier to view the file names only. Is there and option for diff that might do this, or does there exist a similar tool/command that could do the job?
View 1 Replies
View Related
Aug 31, 2011
I was nosing around in my /home folder and I noticed that the /.thumbnails directory had 38,000+ files in it. That number seem a bit excessive to me. Is there a way to limit the number of files that are allowed to be in that directory, and maybe delete the oldest files automatically when the directory reaches it's limit in order to make room for the new incoming files, so there are no "directory full" type of errors?
View 8 Replies
View Related
Apr 28, 2011
If there is any maximum allowed number of files per folder in linux (without risking it to lose everything).
I am using openuse 11.4 with latest kde (4.6?).
I am trying something fast and dirty and it might be that one folder will contain like 10^6 files.
Is there is anything I should be warned about that? Of course filesystem security is still the most important.
View 9 Replies
View Related
Feb 24, 2011
Using tar command. All I need the usage, and basic explanation. Let's assume I have a directory with files that I need to tar, how do I go about it.
View 14 Replies
View Related
Jul 29, 2011
i want to apply this command
Code:
pdftotext article.pdf - | grep DOI
to all the pdf's in a directory and save each line of output to a text file. i.e. i want to collect each line containing "DOI" from every pdf in a text file. I am unable to understand bash scripting enough to write a for loop for this.
View 1 Replies
View Related
Feb 14, 2011
When I run:make -f mymakefile clean I get:rm -f mybinary *.so.* *.dep *.o mybinary.symand all the above files are removed from the current directory.But I have a directory /src/ where I have all my source files located. The *.o file in this directory are not removed?
View 4 Replies
View Related
Sep 28, 2010
I wanna delete a directory with its files and I wanna do that as follows: rm -r dirToDelete Unfortunately, I always get asked for EACH single file if I wanna delete this because it is write protected.... Is there a way to suppress this feedback message so that just the whole directory with its contents disappears?
View 5 Replies
View Related
Jan 2, 2011
If I runls -R1I get a recursive listing of all files under the current directory.However, if I dols -R1 *.avi, ie I want to search only for files with the file descriptor .avi, I get an errorQuote:ls: cannot access *.avi:No such file or directorySo it seems I am using ls incorrectly. What's the correct way to use wild card pattern matching when using the -R switch? Or maybe that isn't possible?
View 2 Replies
View Related
Feb 15, 2010
How to list only hidden files in current directory ?
View 2 Replies
View Related
Dec 2, 2010
how to write a script so that when I use the 'del' command it removes/sends the files / folders to a I specify for example 'dustbin'
View 1 Replies
View Related
May 13, 2011
I am in my current directory. I want to copy a directory somewhere else into this current directory. Lets say I want to take it from direc1/direc2 and the directory I want to take is called demo.
Code:
That is what it shows in the man pages, but when I do that, it says cp: no match
View 5 Replies
View Related
May 19, 2011
I am bulding my own image based on 2.6.32 kernel, I wish to add a guest user:
In a script thats invoked by the makefile, I use 'useradd' command & this updates the shadow, passwd files under /etc on the host, is it possible to tell the command to create the shadow / password under some other folder on the host? may be /tmp?
View 2 Replies
View Related
Jun 10, 2010
I need to copy all subdirectories and files from one directory to another ever 5 minutes or so, with the old data automatically being overwritten with the new data. I'd also like this to run at startup. Is there any way this can be done? If so, what program would I need to schedule the automation and what is the command line I would need.
View 2 Replies
View Related
Jan 11, 2011
With bash is there a way to push and pop the current working directory? I tried writing bash;cd dir; ./dostuff;exit; but the current directory is now dir.
View 2 Replies
View Related
Nov 13, 2010
1. is there a way to prohibit a program from writing data on the hdd?
2. can i have different icons on each gnome workspace and how?
3. how to untar to current directory?
"tar -xvvf blablah.tar.gz" does not work
"tar -xvvf blabla.tar.gz -C ./" does not work
in both cases, the files go into some strange random locations.
4. how can i change the way colors are displayed for different content in the xfce terminal? I used to have red for archives, blue for dirs etc. in kde, but lost all that after changing to gnome.
View 7 Replies
View Related