Tag Info

New answers tagged

0

FILE *fptr=fopen("key.txt","r"); char c; int count=0,i=0; while((c=getc(fptr))!=EOF) {if(c=='\n') count++; } Here you have read and counted the BYTES of the entire file. You have reached the end of the file and cannot read further. You need to either close and reopen the file, or use seek(...) to set back the reading position to the beginning.


0

There's two ways we could interpret this - you don't specify whether you want the script to be run by the Python interpreter, or if you want it to open the script in IDLE. 1. You want to execute the script. While we can't execute the script directly from within Nautilus, we can create a .desktop file that will launch the script for you. Simply open up ...


1

I believe you are looking for something like this: ls -d /home/$USER/Documents/*/ it will list all dirs in Documents. The last "/" makes it "directories" only.


0

Press the alt key. OR ... Move your mouse to the top of the screen.


0

There is nothing wrong if files open in Ubuntu. Just copy your files to your computer. For copying you may use Nautilus (Ubuntu's file manager),or you may use twin-panel file managers like Total Commander in Windows if you prefer. (There are many of them in Software center such as Gnome Commander, Krusader,etc.) Of course you may use command line, as ...


0

After a couple of tries, I finally found the problem. When I run bleachbit as root, it automatically creates files with similar names. I don't know which kind of options cause this, I'm still investigating. EDIT: take a look at this Strange folder in my home folder after a failed run of BleachBit and this ...


0

If your question is really "Will deleting this file damage my system?" No, deleting the file won't damage your system. But we don't know anything about the services and data ON your system. Do just a little more investigation first: When was it saved? (in Italian, for example, 'lug 22' its almost 5 months ago) Do you remember what big changes you wrought ...


0

Windows 8 doesn't do a real shutdown, so if you write to the ntfs filesystem while the windows system in fact is only in sleep it can lead to filesystem corruption an errors. You have to look up how you can force windows to do a real shutdown or use ext explorer to access the linux filesystem from windows.


1

That is exactly what tee is for. Why do you not want to use that? An alternative might be to capture the output, and echo it twice: output=$(nmap localhost) echo "$output" echo "$output" > somefile.txt However, in the special case of nmap, you can take advantage of it's output option -ox : OUTPUT: -oN/-oX/-oS/-oG <file>: Output ...


3

tee is designed to split STDIN into a file and back out to STDOUT. In simple terms, just pipe it through, like so: nmap www.somesite.com | tee file.txt The current accepted alternative involves running nmap twice which is a horrible idea. You'd be better off running it once to file and then outputting the file. nmap www.somesite.com > file.txt; cat ...


-1

It is not possible to have command line view and redirect process at the same time But you can use the following command to use both the process in sequence nmap www.somesite.com && nmap www.somesite.com > file.txt First it will execute the command in terminal and then it will save the output as a file Hope this helps!


1

Easist way is to used this addon for Firefox: https://addons.mozilla.org/en-US/firefox/addon/soundcloud-downloader-techn/


0

An LTS to LTS upgrade will focus on upgrading Ubuntu to a more current version and try and make use of old configuration files, your home partition should be left alone as it is personal data. That is if the upgrade is successful sometimes it can go wrong but this does not very often. I strongly recommend backing up your files on a external hard drive before ...


0

Well, software upgrades shouldn't touch your personal files. Software upgrades try to go with old configuration files, but not always. You should be fine, but me personally, when looking at transitioning dozens of important packages, I'd still wonder if a fresh install isn't too far off, so I'd backup my stuff anyways.


0

i found a workaround for this problem in my Ubuntu installation (14.10). Type the following command in terminal, now you will be able to rename files in UI. $ nautilus


1

you are talking about a file server with apache Just do as follows. Open your terminal and do as below sudo apt-get install apache2 then sudo service apache2 start Just open your browser and type as localhost and press enter. If you see You have installed your webserver successfully. Now we have to setup a file server for you. Now open ...


0

I think you can use "apt-file search "sendsigs" and look for the package that contains this file and reinstall the package


2

Anything related to a user is stored in their home. That includes configurations, settings, the theme you chose but also bookmarks and so on. So there are lots of files in there you need not worry about. Leave them as they are. Deleting them will delete your configuration for the program you deleted it for. If you delete the chromuim directory you ...


1

Helps you to integrate UltraCopier on the Nautilus/Nemo file browser. Ultracopier: Is included on the official ubuntu universe repo and is added as a dependency of the extension, so will be automatically installed. After install: Select one option Restart your computer(recommended) Logout and login Execute for: Nemo: nemo -q (save your work ...


1

BleachBit 1.2 fixes several problems with wiping free disk space including a way to prevent this, so I assume you are using an older version. Now that you have this problem you just have to let rm -rf run. Linux file systems can take a very long time to delete many files, even if they are empty. It may look like nothing is happening for a while, but you ...


-1

My way did not involve the terminal at all but stil, I hope it helps. Here's what I did: Step 1. Highlight the names of all the files you want to move. Step 2. Press Ctrl(control key) and c and the same time Step 3. Go to the folder you want to put your files in, press Ctrl(control key) and v at the same time You're done. Hope it helped you!!


2

find . -type f -exec sh -c 'base=$(echo $1 | grep -oP "(?<=\./).*(?=\.[^\.]*$)"); mkdir -p "${base}"; mv "$1" "$base"' . {} \; Explanation find . -type f This script will operate on all "regular" files (i.e. will not work on the current directory .). -exec sh -c '...' . {} \; execute the '...' part, with the filename fed to the script as an argument ...


0

this will suffice: #!/bin/bash #this script sorts files according to their extensions oldIFS=$IFS IFS=$'\n' (find . -type f) > /tmp/temp for var in `cat /tmp/temp` do name=`basename "$var"` name=`echo $name | cut -d'.' -f1` mkdir -p $name mv "$var" $name/ 2> /dev/null done IFS=$oldIFS


0

cat dumps the text to the terminal. IMO better tools exist, especially for large files. cd ~/Desktop less file.txt nano file.txt nano will allow you to edit the file less will allow page up / page down search (with less and most) using the "/" key and typing the word to search. You may need to install most ;)


0

How one reads the contents of a text file located on the desktop using the terminal: For the logged-in user's desktop: cat ~/Desktop/filename.txt For desktop of another user: cat /home/username/Desktop/filename.txt


-1

Cat is a UNIX command that lets you read text files. So, you can just run the command cat ~/Desktop/FILENAMEHERE unless you are root. If you are root, you must type cat /home/*/Desktop/FILENAMEHERE. Also, you should upgrade to Ubuntu 14.04 or 14.10. THis isn't Windows. It's not okay to use an older version of Ubuntu like it is when you use Windows. You ...


1

Open a terminal window. By default, you will be in your home directory. cd Desktop ls cat "filename"


0

Open it with gedit. When it is a binary file you should ask your teacher. When not you should see the content, more or less helpful.


0

Gzip has error-detecting code, like if there's an error (ex. one changed byte) gzip will complain & tell you about it. Some archive formats like zip and 7z say if there's an error, I just tested gzip (changed one byte in a 3k .gz) and it complained: gzip: test.gz: invalid compressed data--crc error Does gzip (gunzip) complain about any corruption while ...


1

On linux directory modification time change if you: add a new file remove an existent a file or rename a file in it If you change content of existent file, this is not reflected up to directory. Because of this, I suggest to use these commands: find /path/to/folder -type f -mtime +30 -delete this command remove recursively file older than 30 ...


0

I worked it out, while creating a file history in windows, a folder named Data is created where all files are stored. I was confused by the names of the folders. Have a great day ;)


0

Wow! Cool! Short answer The easiest file system around is FAT16, so I would download the source code for that and start messing in there. Long answer Could you elaborate a bit on what you're trying to accomplish here? I mean: File systems are at the rather low end of the development spectrum ("Low" = "Low-level, high in complexity). Edit after comment ...



Top 50 recent answers are included