Pages

Showing posts with label commands. Show all posts
Showing posts with label commands. Show all posts

Sunday, January 15, 2017

Fedora - linux and shell.

The Linux command shell is a very useful and powerful tool and that can help you with Fedora.
Let see the common commands:
pwd - show current directory
ls - displays files/directories and this options:
-a show all (including hidden)
-R recursive list
-r reverse order
-t sort by last modified
-S sort by file size
-l long listing format
-1 one file per line
-m comma-separated output
-Q quoted output
cd - change directory
mkdir - create a directory
rmdir - delete directory
cat - display contents of a file
cp - create a copy of a file
mv - rename or move a file
rm - remove a file

Pipes - let you use multiple commands from one command to another command:
cmd1 | cmd2 stdout of cmd1 to cmd2
cmd1 |$ cmd2 stderr of cmd1 to cmd2
cmd | tee file redirect stdout of cmd to a file and print it to screen

Command lists - commands into list of commands:
cmd1 ; cmd2 run cmd1 then cmd2
cmd1 && cmd2 run cmd2 if cmd1 is successful
cmd1 || cmd2 run cmd2 if cmd1 is not successful
cmd & run cmd in a subshell How to use some lnux commands:
mkdir dir make directory dir
rm file delete file
rm -r dir delete directory dir
rm -f file force delete file
rm -rf dir force delete directory dir - use with extreme CAUTION
cp file1 file2 copy file1 to file2
cp -r dir1 dir2 copy dir1 to dir2; create dir2 if it doesn't exist
mv file1 file2 rename or move file1 to file2 if file2 is an existing directory, moves file1 into directory file2
touch file Create or update file

File Operations
file file1 get type of file1  
cat file1 file2 concatenate file and output
less file1 view and paginate file1  
head file1 show first 10 lines of file1
tail file1 show last 10 lines of file1  
tail -f file1 output last lines of file1 as it changes

Wednesday, September 14, 2016

Record and share your terminal - asciinema.

Most of Fedora linux users use the fedora pastebin known also like fpaste.
Another viable alternative is even more comprehensive and dynamic is thiscommand: asciinema.
You can install this package with dnf install asciinema.
This command come with many options and the result can be see online or download it like json type file.
Let's see some screenshots:


The result it's also upload to internet and you will got one link.

Tuesday, January 15, 2013

The linux command: dmidecode

The linux command dmidecode is a tool for dumping a computer's DMI.

# dmidecode -h
Usage: dmidecode [OPTIONS]
Options are:
 -d, --dev-mem FILE     Read memory from device FILE (default: /dev/mem)
 -h, --help             Display this help text and exit
 -q, --quiet            Less verbose output
 -s, --string KEYWORD   Only display the value of the given DMI string
 -t, --type TYPE        Only display the entries of given type
 -u, --dump             Do not decode the entries
 -V, --version          Display the version and exit

Let's see the option: -t.

# dmidecode -t -h
Invalid type keyword: -h
Valid type keywords are:
  bios
  system
  baseboard
  chassis
  processor
  memory
  cache
  connector
  slot

Now let's show you some infos about my old processor.

# dmidecode -t processor
# dmidecode 2.9
SMBIOS 2.3 present.

Handle 0x0004, DMI type 4, 32 bytes
Processor Information
 Socket Designation: SOCKET A
 Type: Central Processor
 Family: Other
 Manufacturer: AuthenticAMD
 ID: 62 06 00 00 FF FB 83 03
 Signature: Family 6, Model 6, Stepping 2
 Flags:
  FPU (Floating-point unit on-chip)
  VME (Virtual mode extension)
  DE (Debugging extension)
  PSE (Page size extension)
  TSC (Time stamp counter)
  MSR (Model specific registers)
  PAE (Physical address extension)
  MCE (Machine check exception)
  CX8 (CMPXCHG8 instruction supported)
  APIC (On-chip APIC hardware supported)
  SEP (Fast system call)
  MTRR (Memory type range registers)
  PGE (Page global enable)
  MCA (Machine check architecture)
  CMOV (Conditional move instruction supported)
  PAT (Page attribute table)
  PSE-36 (36-bit page size extension)
  MMX (MMX technology supported)
  FXSR (Fast floating-point save and restore)
  SSE (Streaming SIMD extensions)
 Version: AMD Athlon(TM) MP 1700+
 Voltage: 1.7 V
 External Clock: 133 MHz
 Max Speed: 2250 MHz
 Current Speed: 1466 MHz
 Status: Populated, Enabled
 Upgrade: Other
 L1 Cache Handle: 0x0009
 L2 Cache Handle: 0x000A
 L3 Cache Handle: Not Provided

Also you can use this format to read infos.

# dmidecode --type 0 --type 13 

The numbers tell what to read, see:

bios
system  1, 12, 15, 23, 32
baseboard  2, 10, 41
chassis  3
processor  4
memory  5, 6, 16, 17
cache  7
connector  8
slot  9

Wednesday, January 2, 2013

Linux - Fedora and Android make read-only file system.

I don't know what is the problem with Linux - Fedora and Android OS.
After I put my USB cable seam Fedora make from write disk to read-only.
Maybe the Android when scan the device set to read-only.
So you can get some error like this when you use the chown command:
chown: changing ownership of ...: Read-only file system
That can be one big problem when you want to copy files on your tablet.
I found a solution, just use remount.
# mount -o rw,remount /media/disk
If you want to make read-only, use:
# mount -o ro,remount /media/disk
That will solve this issue.