首页 > 系统相关 >Linux command review

Linux command review

时间:2022-08-18 20:35:09浏览次数:45  
标签:review some Below command file Linux

Today, we review some Linux commands and a little bit C programming.
The first command reviewed is STRACE, which is used to trace system calls and signals.

For example, we can use “strace ls foo” to check ls command on file foo under current directory.
Below is the partial result.

The second command introduced is stat, which is to display some file information. Below example displayed some information about file foo.

The third is to create a C program to do the same function like stat does. Below has the details:

In this version, structure variable “buf” is used. Here if we use pointer variable in structure type, we will need to allocate memory first, otherwise we will have “bad address” exception under strace command. Below has the pointer version.

Now, it comes to the result:

In conclusion, Linux system programming is not that complex as it seems. Get more reading and practice, we will have more understanding about Linux OS.

标签:review,some,Below,command,file,Linux
From: https://www.cnblogs.com/zwang562020/p/16600010.html

相关文章

  • Linux安装JDK并配置环境变量
    Linux-安装jdk并配置环境变量1.前往JDK官网,地址:https://www.oracle.com/java/technologies/downloads/  复制下载链接  2. 进入指定目录下使用wget命令......
  • linux 路由配置
    如下图所示有两个网络,分别是0网段和2网段,路由器1组成0网段,路由器2从路由器一种分出一个2网段    如果要在不同网段直接通讯,需要添加路由,linux添加路由命令如下:r......
  • Linux查找文件内容的常用命令方法。
      Linux查找文件内容的常用命令方法。 从文件内容查找匹配指定字符串的行:$grep"被查找的字符串"文件名例子:在当前目录里第一级文件夹中寻找包含指定字符串的.in......
  • 记一次linux用户登录Account locked due to failed logins
    1.背景对端sftp登录传输文件,一直登录不上,一会可以登录,一会又不行,知道彻底登录不上。2.处理#查看被锁次数pam_tally2--usertest#清除次数pam_tally2--user=te......
  • Linux防火墙操作firewall、iptable
    iptables防火墙命令操作#查看防火墙状态serviceiptablesstatus#停止防火墙serviceiptablesstop#启动防火墙serviceiptablesstart#重启防火墙serviceipt......
  • Linux下C语言程序的内存布局
    在《虚拟地址空间以及编译模式》一节中讲到,虚拟地址空间在32位环境下的大小为4GB,在64位环境下的大小为256TB,那么,一个C语言程序的内存在整个地址空间中是如何分布的呢?数据......
  • Linux 运维项目发布指令笔记
    安装xsheel7 如果安装以后显示“该版本是一个beta测试版本”修改本地时间到一个比较早的时间以后再安装可以破除此问题指令:1.ps-ef|grepjava    查看进程......
  • linux--shell
    shell的第一行一般都是#!开头指的是解释器,默认是#!/bin/bash#!/usr/bin/python在路径下执行后缀.sh文件,需要加./,否者没有权限执行解决方法1:在sh文件shebang中加入,#!/b......
  • Redis篇:Linux下操作redis
    目录一、redis介绍安装和配置典型应用场景1.1介绍1.2redis特性1.3下载安装1.4三种启动方式1.5客户端链接1.6redis典型使用场景二、API的使用2.1通用命令2.2字符串......
  • linux 在线安装redis6.2.4
    1.下载安装包(usr/local)wgethttp://download.redis.io/releases/redis-6.2.4.tar.gz1.1如果wget报错安装weget插件yum-yinstallwget 2.解压安装包tar......