Tag Info

New answers tagged

1

It's a simple task for find and cat: find <path_to_files> -type f -print0 | xargs -0 -I {} cat {} >> merged The content of all files in <path_to_files> and in all sub-folders will be added to merged. Therefore remove merged for each new run of the command.


-2

This should work (replacing path/to/dir with the path to the base directory): for i in $(find /path/to/dir -type "f" ); do cat "$i">>OUTPUT.txt;done


2

To completely turn of caching in firefox, open a new tab and type about:config, then search for network.http.use-cache and double-click it to set it to false. Then delete the cache manually, restart firefox, and your doomed files will be gone. The current files are there because your cache is not 0 and that's why they are there, disappear and then get ...


3

Use this: #!/bin/bash saved='b3eeb9430063ee4db5f80b97d4dfb4c4f7667e6e58fd12f849a4ed6779b7f212' find /home/user/ -type f | while IFS= read -r file; do [[ "$(sha256sum "$file" | cut -d' ' -f1)" == $saved ]] && echo "$file" done saved will contain the hashsum of the file you have It will find all the files in /home/user/ (replace it with the ...


0

Just like @fader said: Just press search button and there you can choose do you want to search that folder or all files. That folder is selected as default.


3

$ ls /etc/*- /etc/group- /etc/passwd- /etc/subgid- /etc/gshadow- /etc/shadow- /etc/subuid- These are just backup files. For example /etc/passwd has its backup file with name /etc/passwd- and so on. When programs like useradd, usermod etc. (who has to edit those files) edits them keep a backup copy with - appended at the end. source


0

If you look, for example for your first file, here: http://za.archive.ubuntu.com/dists/vivid-updates/main/binary-amd64/ you'll notice that the size of these files is barely 100k, so you have something pesky going on --- probably a network failure or something like that. Have you tried to check the content of these monster files? Is the filesystem clean? ...


0

sudo apt-get update updates the package manager with the latest versions of software - this is what the two .bz2 files are. It does not actually install new software. You need to follow sudo apt-get update with sudo apt-get upgrade, which will install the latest versions of everything. You can combine them into one command with sudo apt-get update ...


0

In case you're only interested in the Dash to start application, you can simply uninstall lenses with sudo apt-get remove --purge unity-lens-[lensName]. As advised by BullfrogBlues here, that most likely means removing all of them except for unity-lens-applications and possibly unity-lens-files. In case you like the Ubuntu system but feel like Unity is ...


0

I have not tried this before, but this page says you can send binary via minicom by encoding it in ASCII. You need to have busybox installed on the box. Use uuencode to encode. Here is it's syntax: uuencode [INFILE] STORED_FILENAME > send_file INFILE is the path to file to encode and STORED_FILENAME is obviously the name of the file. uuencode outputs ...


0

Without seeing your code, it's hard to tell if your application would OOM or not. Usually, you would read a manageable chunk of data (say 1MB) from the socket and write that chunk of data directly to a file. That way, you'd never store more than the temporary chunk in memory at any one time. Typically this looks like: FileOutputStream fos = new ...


15

There are two ways this can be done: using the ulimit shell utility, or using the setrlimit system call (which is what ulimit calls in turn). using filesystem quotas, and a special user for the server process, will restrict the total usage of that user ulimit/setrlimit From man 2 setrlimit: RLIMIT_FSIZE The maximum size of files that the ...


5

UPDATE: The answer by muru is perfect for file size, I'm here giving a solution how to size a directory itself, not just a file. There is no such thing direct since filesystem deal with a folder as file of files and its limit is the whole filesystem itself. So as a workaround for your problem you can do a trick creating a virtual filesystem and mount it ...


2

I'd say it's safest to check the file size inside the java program. You can append to any file you have write access to, as long as there is enough space in the partition, so you cannot limit a file's size directly. The only thing I can think of is to create a partition only for this file, so the file size will be limited to the partition's size. Also, if ...


2

There is multitude of ways, as you can write text files with any extension you want. With gedit text editor you can save the file as testfile.dat Here's one way in command line: echo "TEST" > testfile.dat Another way in command line to create multiple files with same content: echo "TEST" | tee {one,two,three}.dat You can even rename an existing file ...


16

Creating a test Ext4 filesystem: First make a filesystem on a file to avoid corrupting your real filesystem: dd if=/dev/zero of=test_fs bs=10M count=1 This will create a file called test_fs with a size of 10 megabytes. Then we will create a Ext4 filesystem on it: mkfs.ext4 test_fs Putting some files on it: We have a fully functional filesystem. ...


0

is there a easier way to do it without using the terminal? Yes. You change the destination to your own account. Let's say you have an external USB stick that is identified mounted in /media/ as usb1. By default this stick (when freshly formatted) is owned by user and group root. The command sudo chown -R $USER:$USER /media/usb1 will change all ...


-1

Try running your file manager as root. I believe you right click on the background of your file manager and click open as root, if that doesnt work try that on a folder. If all else fails do sudo <replace with your file manager> or gksu <replace with your file manager>


2

You do not want to read the files. You need to copy them over to another piece of storage. Easiest method Boot from a live DVD and mount the disk where your documents are on. You can mount this disk from the desktop by clicking on the hard disk icon it correspond. See the hard disk icons at the bottom, when you hover over them they will show the ...


1

You can find it in /user/share/X11/ If there is no xorg.conf file there, feel free to create one. In some cases xorg.conf is not needed.


4

I would like to merely expand on the answer that A.B. posted. The wildcard merely expands IDENTIFIER_* to all instances of IDENTIFIER_*. Therefore, mv IDENTIFIER_* in reality is read as mv IDENTIFIER_1 IDENTIFIER_2. This is a same reason why for loops work like so for file in *; do , as well as echo IDENTIFIER_*, and so on and so forth. Now the reason ...


6

If you have only two files, eg: IDENTIFIER_1 IDENTIFIER_2 then you have overwritten IDENTIFIER_2 with the content of IDENTIFIER_1. Example: $ cat IDENTIFIER_1 IDENTIFIER_1 $ cat IDENTIFIER_2 IDENTIFIER_2 $ ls -og IDENTIFIER_* -rw-rw-r-- 1 0 Mai 19 18:28 IDENTIFIER_1 -rw-rw-r-- 1 13 Mai 19 18:27 IDENTIFIER_2 $ mv IDENTIFIER_* $ ls -og IDENTIFIER_* ...


1

You overwrote the second file with the first one. It's lost unless you unmount immediately the partition/device and try to recover it with a tool like testdisk, photorec, extundelete, or whatever.


0

change the name of the folder that contains those files or folders. for example: The_name_of_the_root_folder_that_contains_the_not_manageable_files change it to 1 or Name


4

To show all files created on 16/05/2015: sudo find / -type f -newermt 2015-05-16 Now to see attributes such as owner, modification date, permissions easily use ls -l command: sudo find / -type f -newermt 2015-05-16 | xargs ls -l Thanks to muru note: same result can be achieved with: sudo find / -type f -newermt 2015-05-16 -ls Read this for more ...


2

Just: rm -- -h_some_file_name Or: rm ./-h_some_file_name See the manpage of rm: To remove a file whose name starts with a `-', for example `-foo', use one of these commands: rm -- -foo rm ./-foo The -- argument tells rm that all following argument should not be treated as parameters. A variety of other Linux/Unix command ...


0

You can use wildcards. Here in this case you can use '*' wildcard. Go to the directory where files of this type is to be deleted or you need to mention the complete path in the command. After setting to the terminal prompt to your directory, type in the following rm ./-h* For little bit more information you can see this link: ...


0

@bodhi.zazen accurately showed what the reason for your files not being shown in the output of lsof. Well, since we're lacking a description of your use case, I'll assume that your script does something that takes time changes the content of other files which may have been modified between the time your script starts and the time it's ready to alter the ...


1

lsof accurately lists all open files. The "problem" is that most editors open the file, read the contents (into ram), and then close the file. Editors will then open the file when writing changes. To see if any editors are using the file, for all users, run ps aux | grep file name Example Open a test.file with nano in one terminal. In another terminal ...


0

To make it run when double in clicked in nautilus: Open Nautilus. Open this from the menu bar: Edit → Preferences Select the 'Behavior' tab. Select "Ask each time" under "Executable Text Files". Close the window. Now you can double-click your executable text file in Nautilus to be asked whether to execute or edit your script. Similarly for ...


1

Try using Arronax. It's a .desktop file editor that works well. You can create .desktop files for binary/script files, or .desktop files that run a command. You can also set the icon for the .desktop file.


0

Right click on the file. Choose properties and the "open with" tab and pick a program that you can use to open "bin" files. There are several programs for this: Furius ISO Mount, Acetone Iso. But you might have some other software installed. A reminder: ISO is a CD Rom format... in general you do not need a program for it and just burn it to a CD Rom.


9

Finding Files with bat Anywhere To find all files anywhere inside /path/to/folder whose names contain bat, you can use: find /path/to/folder -name '*bat*' I have quoted the search pattern *bat* because, if the quotes were omitted and files match *bat* in the current directory, the shell will expand *bat* into a list of them and pass that to find. Then ...


2

Use the good old find. find <path_for_search> -type f -iname "*bat*" eg.: % find . -type f -iname "*bat*" ./batgirl.c ./batwoman.c ./cricketbat.c ./batman.c from man find: -type c File is of type c: [..] d directory [..] f regular file [..] -iname pattern Like ...


5

If the files are in the current directory use: $ ls *bat* batgirl.c batman.c batwoman.c cricketbat.c Or (to have them line by line): $ ls -1 *bat* batgirl.c batman.c batwoman.c cricketbat.c If you want to search the system for that files, use: $ find / -name "*bat*" /path/to/cricketbat.c /path/to/batgirl.c /path/to/batwoman.c /path/to/batman.c


12

The easiest way is to run locate bat This way you can search through the whole computer for files containing "bat" in the file name To refresh the list of files on your PC run updatedb Run this command when you have recently added new files to your account


13

Open the terminal and change directories to the directory from where you want to start searching and then run this command: find . -name "*bat*" -type f The . starts the find command from the current directory. The -name matches the string bat and is case sensitive. (-iname is case insensitive) The -type f searches for files only.


3

You want to use the find command, with the -iname option for case insensitive file name matching, or the -name option for case sensitive file name matches. Both of these will let you use wildcard names. So, to find any file names which contain "bat" you would use: find / -iname '*bat*' Or find / -name '*bat*' The * means "any character(s)", so the ...


6

The simplest solution would be to move the files to a different directory. That way, at least your $HOME will load. Open a terminal and run these commands: mkdir jpeg-dir find . -maxdepth 1 -type f -iname '*jpg' -or -iname '*jpeg' -exec mv {} jpeg-dir + That will move all files whose name ends in jpg, jpeg, JPEG, JPG etc, to ~/jpeg-dir. That should let ...


5

What is happening is that the filemanager is creating a list (with ls) and that is going to take a long long time when there are lots of files. So 1st thing to do is to clean up /home/$USER/. Go into console mode. cd ~ mkdir tmp This will create a tmp directory in your /home/$USER/. Now do an ls -l | more and press enter to get an idea about what ...


3

You can use if conditional construct to perform an action depending on some condition e.g. if something exists or not. In your case you need to put the action segment inside the if-then condition: if ! [[ -f "_thumb_wd_${f%.pdf}.jpg" ]]; then convert -thumbnail 250x200 "$f"[0]"_thumb_wd_${f%.pdf}.jpg" fi [[ is a bash keyword, we are using it to ...


1

/var/log/lastlog is a sparse file meaning its real size is not reported by ls -l but by ls -s. This means that your lastlog might not be as huge as you think: Try: ls -s /var/log/lastlog to get a report of its size in blocks. The sudden growth of /var/log/lastlog means a high UID user as logged out. Look at lastlog man page Edit - To fix it: You can ...


0

I got it working this way. On your Galaxy tab go to :Settings->Wireless&Network->USB Settings-> select Mass Storage. Then connect the Galaxy tab to your computer and select "mount"



Top 50 recent answers are included