Posts Tagged ‘command line’
Useful apt commands (Ubuntu, Debian, Mint etc.)
Terminal commands for package management can be an essential thing if you come across an unexpected error or are just interested in how things work. Here are a few of the more important ones:
apt-cache search –names-only –installed
Followed by a pattern, the above command searches every package in its cache for it (you can leave or add the given options starting with –).
apt-cache showpkg
Followed by a package name, this command gives you basic information about it, e.g version number, dependencies…
apt-cache stats
This command gives basic statistics about your package cache.
apt-cache depends
Followed by a package name, this command gives you all of the package’s dependencies.
apt-cache unmet
This command gives you a list of unmet dependencies.
cat /etc/apt/sources.list
Gives you a list of your repositories. The file can also be opened with a text editor to be edited.
ls /etc/apt/sources.list.d
Shows the contents of the given directory, where your installed ppa are stored in.
Hide folders by making them system folders on Windows
One of the basic things one does while configuring a Windows system is to enable viewing hidden files. So basically it is impossible to hide files by making them “hidden”.
What helps against most nosy people though is to make a file a system file or folder – that way the tagged file will remain hidden even if “hidden” files are made visible (of course one can still make system files visible but few people will enable that since it’s usually not necessary).
To tag a file a system file, open a command prompt by entering cmd into your search bar. Enter following into the command line, replacing the path I use with the one to your file (+s is for systemfile and +h is for hidden):
attrib +s +h C:\Users\howtoforge\Desktop\bla
To make it visible again, just turn the plusses into minusses:
attrib -s -h C:\Users\howtoforge\Desktop\bla
Show battery capacity for notebooks on Windows
Notebook batteries lose part of their capacity over time depending on their treatment. To see at how much maximum capacity your battery it, there is a command line tool that you can use from an elevated command line. To open such, search your main menu for cmd, right-click it and choose Run as administrator. In the command line, enter following:
powercfg -energy
The tool will then observe the system for 60 seconds and will then save an energy report in the default location if not specified otherwise, which is C:\Windows\System32\. You will not be able to open from there so just drag and drop it to the desktop or some other none-system folder. Somewhere near the middle of the document you will find the battery information. Mine look like this:
Battery:Battery Information
Battery ID 206SANYODell
Manufacturer SANYO
Serial Number 206
Chemistry LION
Long Term 1
Design Capacity 93240
Last Full Charge 85892
The ratio of the last two values is the current capacity of your battery:
85892 / 93240 = 0,921
which is about 92% capacity.